fastlane: Google Play Store APK version code conflicts between tracks...
New Issue Checklist
- Updated fastlane to the latest version
- I have read the Contribution Guidelines
Issue Description
TLDR-> I expect APK’s with a higher versionCode to automatically deactivate versions in preceding tracks with a lower versionCode.
S’pose the APK in Alpha has versionCode 1. I want to upload a new version to Beta with versionCode 2.
When I try to do this I get the following error:
Version 2 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.
I understand the reasoning behind this error, but this is not the expected behavior as described by the Google documentation:
- If a beta APK is uploaded with a higher version code than an alpha APK, the alpha version will automatically be deactivated.
- If a Production APK is uploaded with a higher version code than an alpha or beta APK, the alpha and/or beta version will automatically be deactivated.
What I expect is the Alpha track with versionCode 1 to automatically be deactivated and the new APK with version 2 to be uploaded to the Beta track. This logic also applies to the Production track, where any version uploaded to the Production track with a higher version code than the versions that are in Beta and Alpha should automatically disable those tracks.
Complete output when running fastlane, including the stack trace and command used
+-------------------------+--------------------------------------------------------------------+
| Summary for supply 0.7.1 |
+-------------------------+--------------------------------------------------------------------+
| track | beta |
| skip_upload_images | true |
| skip_upload_screenshots | true |
| apk | /home/ubuntu/sw-android/app/build/outputs/apk/app-prod-release.apk |
| package_name | com.shaleapps.logistics |
| rollout | 1.0 |
| metadata_path | ./fastlane/metadata/android |
| json_key | key.json |
| skip_upload_apk | false |
| skip_upload_metadata | false |
+-------------------------+--------------------------------------------------------------------+
[20:54:12]: Preparing to upload for language 'en-US'...
[20:54:13]: Updating changelog for code version '39' and language 'en-US'...
[20:54:13]: Updating changelog for code version '40' and language 'en-US'...
[20:54:13]: Updating changelog for code version '41' and language 'en-US'...
[20:54:14]: Updating changelog for code version '42' and language 'en-US'...
[20:54:14]: Updating changelog for code version '43' and language 'en-US'...
[20:54:14]: Updating changelog for code version '44' and language 'en-US'...
[20:54:14]: Updating changelog for code version '45' and language 'en-US'...
[20:54:14]: Updating changelog for code version '46' and language 'en-US'...
[20:54:15]: Updating changelog for code version '47' and language 'en-US'...
[20:54:15]: Updating changelog for code version '56' and language 'en-US'...
[20:54:15]: Updating changelog for code version '57' and language 'en-US'...
[20:54:16]: Updating changelog for code version '920' and language 'en-US'...
[20:54:16]: Updating changelog for code version '923' and language 'en-US'...
[20:54:17]: Updating changelog for code version '931' and language 'en-US'...
[20:54:17]: Updating changelog for code version '1002' and language 'en-US'...
[20:54:17]: Preparing apk at path '/home/ubuntu/sw-android/app/build/outputs/apk/app-prod-release.apk' for upload...
[20:54:20]: Updating track 'beta'...
[20:54:20]: Uploading all changes to Google Play...
[20:54:21]: Variable Dump:
[20:54:21]: {:DEFAULT_PLATFORM=>:android, :PLATFORM_NAME=>:android, :LANE_NAME=>"android beta", :GRADLE_BUILD_TYPE=>"release", :GRADLE_FLAVOR=>"prod", :GRADLE_ALL_APK_OUTPUT_PATHS=>["/home/ubuntu/sw-android/app/build/outputs/apk/app-prod-release.apk"], :GRADLE_APK_OUTPUT_PATH=>"/home/ubuntu/sw-android/app/build/outputs/apk/app-prod-release.apk"}
[20:54:21]: Google Api Error: multiApkShadowedActiveApk: Version 1123 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.
+------+-------------------------------------+-------------+
| fastlane summary |
+------+-------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------------------------+-------------+
| 1 | Verifying required fastlane version | 0 |
| 2 | default_platform | 0 |
| 3 | gradle | 28 |
| 4 | gradle | 171 |
| 💥 | supply | 9 |
+------+-------------------------------------+-------------+
[20:54:21]: fastlane finished with errors
[!] Google Api Error: multiApkShadowedActiveApk: Version 1123 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.
fastlane beta returned exit code 1
Action failed: fastlane beta
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 26 (6 by maintainers)
@markpar, @gmarques33, @arohim
I think I found the source of this bug, what happens is that you probably have a version that is shown as Superseded by production on the beta channel:
This means despite the UI not showing, if you use the Edits.tracks: get api there will be a “stuck” old apk in the beta channel.
For some reason google doesn’t allow it to upload when this happen.
There’s an api to unassign versions of a track, I took a look at the code and I believe it can be fixed by clearing the earlier tracks if a later track has a greater version code, before uploading the new apk.
I’m running into a situation where when we skip the beta deployment (alpha -> prod), the next time we try to deploy to alpha, we’re getting this error.
E.g.: v1 -> alpha via Fastlane deploy.
v1 -> beta via Google Play Console v1 -> prod via Google Play Console (this is our usual flow)
Then…
v2 -> alpha via Fastlane deploy. v2 -> directly to prod via Google Play Console
Then…
v3 -> alpha via Fastlane deploy <------ Google Api Error: multiApkShadowedActiveApk: Version 3 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.
Halp? Bug?
By the way I’ve submitted the above #9250 PR that at least in my tests solved the problem, if any of you guys have this problem you can help testing.
Just to provide some help for people facing this issue, you can achieve this by uploading the new APK to alpha and then promoting to beta. So, let’s say you have APK version 100 in alpha, and want to release APK version 200 to beta. The easiest way to do this is to upload version 200 to alpha, then promote the alpha track to beta.
A fastfile configuration for promoting to beta might look something like this:
And of course, you could combine the “upload to alpha and promote to beta” into a single lane if you wish.
Using fastlane I’m experiencing the same issue. However, if I upload the APK using the google developer console UI it works as described in Google’s documentation where “If a beta APK is uploaded with a higher version code than an alpha APK, the alpha version will automatically be deactivated.”
To reproduce the issue:
Google Api Error: multiApkShadowedActiveApk: Version xxxx of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.@renannery actually doesn’t work for me:
still the same error
@asfalcone
Yes, supply should conform to the following behavior:
If you want to implement continuous deployment with a GitFlow structured repository and Google Play Store, this behavior is required. The way that supply currently works, you can only push to the alpha track from the development, release and production branches and you have to manually progress the builds through the release tracks using the Google Play Console.
@asfalcone right now
supplycan’t deploy to Beta because Alpha is active. So, I think in my case at least, I would like to have the option to automatically deactivate Alpha. Something in the lines ofsupply(track: 'beta', deactivate_alpha: true)should do the trick and keep it backward compatible. Please note that this example is short sighted to my case only as if you deploy to therollouttrack,betaandalphatracks might need to be deactivated (I don’t know for sure as I have not tested this yet).