A new Flutter release APK installs or uploads as the old version
Flutter build apk on release mode cannot generate updated versionShort answer
Android decides what is an update from the version code, and Flutter takes it from the build number in pubspec.yaml. If you rebuild without raising it, the new APK looks identical to the old one. Raise the number after the plus sign, rebuild, and pick the APK from build/app/outputs.
Fix it fast
1Find out which cause you have
Check which version the project will build with. The number after the plus sign becomes the Android version code.
grep -n "^version:" pubspec.yaml2Match what you see, then jump to its fix
- 1
version: 1.0.0+1 is the same as in the last build you shippedThe version in pubspec.yaml was not changedFix - 2
The build finished with new code, but the app behaves like the old buildYou are installing or uploading an old fileFix - 3
adb install fails on an already installed appadb install is refused or keeps the old buildFix - 4
Play or the device shows a version code far above the number after the plus signSplit APKs have version codes that differ from your build numberFix
- 1
What does the error look like?
Flutter build apk on release mode cannot generate updated versionThe new APK installs but the app still shows the old versionadb install of the new APK does not replace the installed build
Cause 1 of 4
The version in pubspec.yaml was not changed
1Check
Flutter reads versionName and versionCode from the version field in pubspec.yaml. The part before the plus sign is the version name; the part after it is the build number, which becomes the version code. Rebuilding with the same line gives an APK that looks the same to Android and to Google Play.
grep -n "^version:" pubspec.yaml2Fix
Raise the build number every time you ship. You can edit pubspec.yaml, or override both values for one build with the build flags.
# pubspec.yaml
version: 1.0.1+2
# or, for one build only
flutter build apk --build-name=1.0.1 --build-number=23Verify
Rebuild, then reinstall or upload the new file.
flutter build apkConfirmed by docs.flutter.dev
Cause 2 of 4
You are installing or uploading an old file
1Check
Release files are written under build/app/outputs in your project. With --split-per-abi there is one file per CPU type in the flutter-apk folder, so an older file for a different ABI can sit next to the new one. Look at the timestamps.
ls -lt build/app/outputs/flutter-apk/2Fix
Use the file with the newest timestamp that matches the device. For an app bundle the file is build/app/outputs/bundle/release/app.aab.
flutter build apk --split-per-abi
ls -lt build/app/outputs/flutter-apk/3Verify
Install the newest file on the connected device.
flutter installConfirmed by docs.flutter.dev
Cause 3 of 4
adb install is refused or keeps the old build
1Check
Android only treats an install as an update when the app is already present and the version code is not lower. A lower code counts as a downgrade, which adb rejects unless you ask for it.
adb install -r build/app/outputs/flutter-apk/app-release.apk2Fix
Reinstall with -r to keep the app data. For a lower version code during testing, add -d to allow the downgrade; a later build number is the cleaner fix.
adb install -r build/app/outputs/flutter-apk/app-release.apk
adb install -r -d build/app/outputs/flutter-apk/app-release.apk3Verify
The install prints Success and the app opens with the new version shown inside it.
adb install -r build/app/outputs/flutter-apk/app-release.apkConfirmed by developer.android.com
Cause 4 of 4
Split APKs have version codes that differ from your build number
1Check
With split APKs the Flutter tooling adds ABI_VERSION * 1000 to the version code, so each CPU type gets its own code. That is by design and not a failed update.
flutter build apk --split-per-abi2Fix
Keep raising the build number for every release. The Flutter page documents a Gradle property, force-version-code-ignoring-abi=true, that keeps the plain code; read that page before using it.
flutter build apk --split-per-abi --build-number=33Verify
Compare the files in the flutter-apk folder after the build.
ls -l build/app/outputs/flutter-apk/Confirmed by docs.flutter.dev
How do I stop it coming back?
- Raise the build number in pubspec.yaml in the same commit that you tag for release.
- In CI, pass --build-number from a counter so two builds never share a version code.
- Keep the old and new files in separate folders so you never upload the wrong one.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
Google Play says the app does not support 16 KB memory pages
check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a
Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.
5 causes, each with a fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fixMobile apps
Android resource linking fails with resource android:attr/lStar not found
error: failed linking references.
The lStar attribute exists only from Android API 31.
2 causes, each with a fix