You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flutter version code is different from version code in google play console #49544
When uploading app to playstore I understand that we need our app to have a unique version code for each build and in flutter the version code is said to be what follows + in pubspec.yaml.
e.g version: 1.0.0+3 has a version code of 3 but when I upload my split apk's built using flutter build apk --split-per-abi to google play console has version code as 4003,2003&1003
The problem is the version codes get huge when using split apks and it doesn't seem to respect the version number specified in pubspec.yaml.
edit: The question right now is if a user wishes to deploy split apks to the playstore, How should the app versioning be handled? Since the version numbers of split apk are huge when uploaded to playstore.
I understand if I set a versionCode=3
the split apk generated will be
ARM 32-bit): 1003
ARM 64-bit: 2003
x86 64-bit: 4003
but next time I set versionCode=4, play console won't accept build variants with version code less than 4003
the split apk generated will be
ARM 32-bit): 1004
ARM 64-bit: 2004
x86 64-bit: 4004
Hi, I am also facing the same issue. For some security reason i am checking the app version and send it to backend. In my backend i have the version code like 5. But when i am reading the version code using package_info i am getting the version code like 1005, 2005 and 4005. How can i get the exact version code? Any idea?
Note: i cant use bundle. we don't have access for certificate file.
Hi, I am also facing the same issue. For some security reason i am checking the app version and send it to backend. In my backend i have the version code like 5. But when i am reading the version code using package_info i am getting the version code like 1005, 2005 and 4005. How can i get the exact version code? Any idea?
Note: i cant use bundle. we don't have access for certificate file.
When you add split{} to the build.gradle and try to customize the versioning, --split-per-abi is still using its own default behavior of generating the versionCode
Hey, running into this too. Seems like the "intended behaviour" is for split apks to use the version code generated by flutter.gradle check line 631. This seems to override any changes I make to the version code in my app/gradle, is it possible to make this optional? @jonahwilliams
Hey, running into this too. Seems like the "intended behaviour" is for split apks to use the version code generated by flutter.gradle check line 631. This seems to override any changes I make to the version code in my app/gradle, is it possible to make this optional? @jonahwilliams
but the problem with split apk is the build number gets huge as pointed here #49544 (comment)
nextime I upload a build the build number has to be more than 4003
Hey, running into this too. Seems like the "intended behaviour" is for split apks to use the version code generated by flutter.gradle check line 631. This seems to override any changes I make to the version code in my app/gradle, is it possible to make this optional? @jonahwilliams
I made a workaround by overriding the split logic in flutter.gradle. Add this code in your android {} block. You can try it.
The question right now is if a user wishes to deploy split apks to the playstore, How should the app versioning be handled? Since the version number is huge when uploaded to playstore.
Hey, I'm facing the same issues from version code. The app store within our countries can only support APK. And we need to provide both of arm and arm64 version of our app with the same version code. --split-per-abi is a convenient way to build arm and arm64 artifacts in only one command, but the version code is suffixed with 1000 for arm and 2000 for arm64, and it's really strange and rejected by the app store. I understand it may be an intended behavior, I just describe what I has encountered during uploading my app to the app store :)
Note that I'm not really understanding what I'm doing here, the snipped was created by trial-and-error-programming. Fell free to improve it.
EDIT: This snippet does not work after the update to Flutter 3.35. Flutter 3.35.3 will fix it, see #173917. EDIT2: Still broken with Flutter 3.35.3. EDIT3: It was a Flutter 3.32 "broken feature" that allowed the workaround to work. This was fixed in Flutter 3.35 in the closed possible way. i.e. reintroduce this bug and remove the workaround. I don't think we're going to see this 5 year old issue ever solved.
Could we document this a little more prominently? A little "If you are using split APKs, we add 1000, 2000 or 4000 depending on the ABI" in the template build.gradle would have saved me a good half hour of confusion :)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
VladyslavBondarenko commentedon Jan 27, 2020
Related to #39817
jonahwilliams commentedon Feb 8, 2020
This is the intended behavior of split APKs, for more information see:
https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions
sathya4code commentedon Apr 26, 2020
Hi, I am also facing the same issue. For some security reason i am checking the app version and send it to backend. In my backend i have the version code like 5. But when i am reading the version code using package_info i am getting the version code like 1005, 2005 and 4005. How can i get the exact version code? Any idea?
Note: i cant use bundle. we don't have access for certificate file.
sathya4code commentedon Apr 27, 2020
Hi.. Any update regarding this?
koraxis commentedon May 6, 2020
Hi, --split-per-abi doesnt work with the suggestions from https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions.
When you add
split{}to the build.gradle and try to customize the versioning, --split-per-abi is still using its own default behavior of generating the versionCodedanybuoy commentedon May 9, 2020
Hey, running into this too. Seems like the "intended behaviour" is for split apks to use the version code generated by flutter.gradle check line 631. This seems to override any changes I make to the version code in my app/gradle, is it possible to make this optional? @jonahwilliams
maheshj01 commentedon Apr 20, 2021
but the problem with split apk is the build number gets huge as pointed here #49544 (comment)
nextime I upload a build the build number has to be more than 4003
yohom commentedon Jun 30, 2021
I made a workaround by overriding the split logic in
flutter.gradle. Add this code in yourandroid {}block. You can try it.maheshj01 commentedon Jun 21, 2022
The question right now is if a user wishes to deploy split apks to the playstore, How should the app versioning be handled? Since the version number is huge when uploaded to playstore.
yusuphwickama commentedon Jul 4, 2022
Here is a working version for android/app/build.gradle
Kingtous commentedon Jun 24, 2023
Hey, I'm facing the same issues from version code. The app store within our countries can only support APK. And we need to provide both of arm and arm64 version of our app with the same version code.
--split-per-abiis a convenient way to build arm and arm64 artifacts in only one command, but the version code is suffixed with1000for arm and2000for arm64, and it's really strange and rejected by the app store. I understand it may be an intended behavior, I just describe what I has encountered during uploading my app to the app store :)mhkarami commentedon Apr 27, 2024
here is the solution :
https://stackoverflow.com/a/78395354/8660482
rusty-snake commentedon Aug 26, 2025
Here is a working version for
android/app/build.gradle.kts:android { // ... } androidComponents { onVariants { variant -> variant.outputs.forEach { output -> output.versionCode.set(flutter.versionCode) } } }Note that I'm not really understanding what I'm doing here, the snipped was created by trial-and-error-programming. Fell free to improve it.
EDIT: This snippet does not work after the update to Flutter 3.35.
Flutter 3.35.3 will fix it, see #173917.EDIT2: Still broken with Flutter 3.35.3.
EDIT3: It was a Flutter 3.32 "broken feature" that allowed the workaround to work. This was fixed in Flutter 3.35 in the closed possible way. i.e. reintroduce this bug and remove the workaround. I don't think we're going to see this 5 year old issue ever solved.
derdilla commentedon Jun 8, 2026
Could we document this a little more prominently? A little "If you are using split APKs, we add 1000, 2000 or 4000 depending on the ABI" in the template build.gradle would have saved me a good half hour of confusion :)
Implement version code overrides for split ABIs (flutter#187742)
github-actions commentedon Jul 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.