New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Play Store APK version code conflicts between tracks... #6791

Closed
KalebKE opened this Issue Oct 28, 2016 · 26 comments

Comments

Projects
None yet
@KalebKE

KalebKE commented Oct 28, 2016

New Issue Checklist

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
@renannery

This comment has been minimized.

Show comment
Hide comment
@renannery

renannery Oct 30, 2016

The same error here Google Api Error: multiApkShadowedActiveApk: Version 1320055 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes

renannery commented Oct 30, 2016

The same error here Google Api Error: multiApkShadowedActiveApk: Version 1320055 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes

@hypery2k

This comment has been minimized.

Show comment
Hide comment
@hypery2k

hypery2k Oct 30, 2016

having the same error

hypery2k commented Oct 30, 2016

having the same error

@TKBurner

This comment has been minimized.

Show comment
Hide comment
@TKBurner

TKBurner Nov 1, 2016

@KalebKE @renannery @hypery2k Thanks for reaching out about this. I sent it out to the core team for a comment. Hope you have a great day!

TKBurner commented Nov 1, 2016

@KalebKE @renannery @hypery2k Thanks for reaching out about this. I sent it out to the core team for a comment. Hope you have a great day!

@renannery

This comment has been minimized.

Show comment
Hide comment
@renannery

renannery Nov 2, 2016

Just for the record, I kind of figure out the issue. I was getting this error because I was splitting my apks with x86 ABI set as the first build and the store was showing up some warns related to issues with ABI compatibility and version code.

I do recommend to change this configuration on your gradle file

Here is my current setup for ABI split
project.ext.versionCodesABI = ['armeabi-v7a':1, 'mips':2, 'x86':3]

renannery commented Nov 2, 2016

Just for the record, I kind of figure out the issue. I was getting this error because I was splitting my apks with x86 ABI set as the first build and the store was showing up some warns related to issues with ABI compatibility and version code.

I do recommend to change this configuration on your gradle file

Here is my current setup for ABI split
project.ext.versionCodesABI = ['armeabi-v7a':1, 'mips':2, 'x86':3]

@hypery2k

This comment has been minimized.

Show comment
Hide comment
@hypery2k

hypery2k Nov 2, 2016

@renannery actually doesn't work for me:


project.ext.versionCodesABI = ['arm64-v8a': 1, 'armeabi-v7a': 2, 'x86': 3]

android {

  splits {
    abi {
      enable true //enables the ABIs split mechanism
      reset() //reset the list of ABIs to be included to an empty string
      include 'arm64-v8a', 'armeabi-v7a', 'x86'
      universalApk true
    }
  }

  lintOptions {
    abortOnError false
  }

still the same error

hypery2k commented Nov 2, 2016

@renannery actually doesn't work for me:


project.ext.versionCodesABI = ['arm64-v8a': 1, 'armeabi-v7a': 2, 'x86': 3]

android {

  splits {
    abi {
      enable true //enables the ABIs split mechanism
      reset() //reset the list of ABIs to be included to an empty string
      include 'arm64-v8a', 'armeabi-v7a', 'x86'
      universalApk true
    }
  }

  lintOptions {
    abortOnError false
  }

still the same error

@asfalcone

This comment has been minimized.

Show comment
Hide comment
@asfalcone

asfalcone Nov 22, 2016

Contributor

@hypery2k Can you share the full output from running supply?

Contributor

asfalcone commented Nov 22, 2016

@hypery2k Can you share the full output from running supply?

@hypery2k

This comment has been minimized.

Show comment
Hide comment
@hypery2k

hypery2k Nov 24, 2016

works for me now. I think Android/Google has changed the Build-Numbering. Before I had build-number 1035 and now it's becoming 103. I use the Jenkins-Buildnumber as version code. So I think the error is on the Android side

hypery2k commented Nov 24, 2016

works for me now. I think Android/Google has changed the Build-Numbering. Before I had build-number 1035 and now it's becoming 103. I use the Jenkins-Buildnumber as version code. So I think the error is on the Android side

@KalebKE

This comment has been minimized.

Show comment
Hide comment
@KalebKE

KalebKE Dec 7, 2016

I am still experiencing the issue.

KalebKE commented Dec 7, 2016

I am still experiencing the issue.

@selkhateeb

This comment has been minimized.

Show comment
Hide comment
@selkhateeb

selkhateeb Jan 4, 2017

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:

  • Make sure you have configured the alpha and beta tracks to "closed" in the Google's Developer Console,
  • Build the project and deploy to Alpha,
  • Build again with a new versionCode and deploy to Beta.
    you will get the following error:
    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.

selkhateeb commented Jan 4, 2017

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:

  • Make sure you have configured the alpha and beta tracks to "closed" in the Google's Developer Console,
  • Build the project and deploy to Alpha,
  • Build again with a new versionCode and deploy to Beta.
    you will get the following error:
    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.
@asfalcone

This comment has been minimized.

Show comment
Hide comment
@asfalcone

asfalcone Jan 10, 2017

Contributor

@KalebKE @selkhateeb Are you thinking that supply needs to deactivate the alpha version manually then?

Contributor

asfalcone commented Jan 10, 2017

@KalebKE @selkhateeb Are you thinking that supply needs to deactivate the alpha version manually then?

@selkhateeb

This comment has been minimized.

Show comment
Hide comment
@selkhateeb

selkhateeb Jan 12, 2017

@asfalcone right now supply can'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 of supply(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 the rollout track, beta and alpha tracks might need to be deactivated (I don't know for sure as I have not tested this yet).

selkhateeb commented Jan 12, 2017

@asfalcone right now supply can'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 of supply(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 the rollout track, beta and alpha tracks might need to be deactivated (I don't know for sure as I have not tested this yet).

@asfalcone

This comment has been minimized.

Show comment
Hide comment
@asfalcone

asfalcone Jan 12, 2017

Contributor

This sounds like great functionality to add to supply. I'd love to review a PR for this! 👍

Contributor

asfalcone commented Jan 12, 2017

This sounds like great functionality to add to supply. I'd love to review a PR for this! 👍

@KalebKE

This comment has been minimized.

Show comment
Hide comment
@KalebKE

KalebKE Jan 14, 2017

@asfalcone

Yes, supply should conform to the following behavior:

  • 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.

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.

KalebKE commented Jan 14, 2017

@asfalcone

Yes, supply should conform to the following behavior:

  • 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.

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.

@s-gagandeep

This comment has been minimized.

Show comment
Hide comment
@s-gagandeep

s-gagandeep Mar 3, 2017

@asfalcone any update on this, i am also facing the same problem, i have uploaded apk on alpha, but now i am trying to upload apk with higher version code via supply it is giving error
[!] Google Api Error: multiApkShadowedActiveApk: Version 2 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.

s-gagandeep commented Mar 3, 2017

@asfalcone any update on this, i am also facing the same problem, i have uploaded apk on alpha, but now i am trying to upload apk with higher version code via supply it is giving error
[!] Google Api Error: multiApkShadowedActiveApk: Version 2 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.

@tmtrademarked

This comment has been minimized.

Show comment
Hide comment
@tmtrademarked

tmtrademarked Mar 4, 2017

Contributor

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:

lane :promote_beta do
    supply(
      package_name: "com.my.app",
      track: "alpha",
      track_promote_to: "beta",
      metadata_path: "fastlane/myapp/",
      skip_upload_apk: true,
      skip_upload_metadata: true,
      skip_upload_images: true,
      skip_upload_screenshots: true,
    )
  end

And of course, you could combine the "upload to alpha and promote to beta" into a single lane if you wish.

Contributor

tmtrademarked commented Mar 4, 2017

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:

lane :promote_beta do
    supply(
      package_name: "com.my.app",
      track: "alpha",
      track_promote_to: "beta",
      metadata_path: "fastlane/myapp/",
      skip_upload_apk: true,
      skip_upload_metadata: true,
      skip_upload_images: true,
      skip_upload_screenshots: true,
    )
  end

And of course, you could combine the "upload to alpha and promote to beta" into a single lane if you wish.

@sivakaruprolu

This comment has been minimized.

Show comment
Hide comment
@sivakaruprolu

sivakaruprolu Apr 27, 2017

Eventhough i am updating a newer version into beta path still i have been facing this error from many days,have gone through many links still facing the issue. My main issue is i have uploading the apk with 136 version Code but in error it was showing 116.please let me know if u have cracked the bug.For reference please go through the below error message

Preparing apk at path './app/build/outputs/apk/app-production.apk' for upload...
Updating track 'beta'...
Validating all changes with Google Play...
�[31m
[!] Google Api Error: multiApkShadowedActiveApk: Version 116 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.�[0m

sivakaruprolu commented Apr 27, 2017

Eventhough i am updating a newer version into beta path still i have been facing this error from many days,have gone through many links still facing the issue. My main issue is i have uploading the apk with 136 version Code but in error it was showing 116.please let me know if u have cracked the bug.For reference please go through the below error message

Preparing apk at path './app/build/outputs/apk/app-production.apk' for upload...
Updating track 'beta'...
Validating all changes with Google Play...
�[31m
[!] Google Api Error: multiApkShadowedActiveApk: Version 116 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.�[0m

@RyogaK

This comment has been minimized.

Show comment
Hide comment
@RyogaK

RyogaK Apr 27, 2017

@sivakaruprolu I'm facing same problem just now without supply (and fastlane). It may not supply's fault. We should probably contact to Google rather than here.

RyogaK commented Apr 27, 2017

@sivakaruprolu I'm facing same problem just now without supply (and fastlane). It may not supply's fault. We should probably contact to Google rather than here.

@BobString

This comment has been minimized.

Show comment
Hide comment
@BobString

BobString Apr 27, 2017

Are you using multiple apk in the play store? Or even if you are using one apk but use the splits gradle function, that is considered "multiple" apk to the play store. I think that error can be avoided using a version code scheme like the one described here, although I haven't tried it out myself: https://developer.android.com/google/play/publishing/multiple-apks.html#VersionCodes

BobString commented Apr 27, 2017

Are you using multiple apk in the play store? Or even if you are using one apk but use the splits gradle function, that is considered "multiple" apk to the play store. I think that error can be avoided using a version code scheme like the one described here, although I haven't tried it out myself: https://developer.android.com/google/play/publishing/multiple-apks.html#VersionCodes

@ChristopherStephan

This comment has been minimized.

Show comment
Hide comment
@ChristopherStephan

ChristopherStephan May 3, 2017

I am using beta lane only for test releases and got the same error message. "Fixed" it by changing the track to alpha in my script, then moving the apk manually to beta track and finally switching back to the beta track in my script.

Google Api Error: multiApkShadowedActiveApk: Version 89 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.

ChristopherStephan commented May 3, 2017

I am using beta lane only for test releases and got the same error message. "Fixed" it by changing the track to alpha in my script, then moving the apk manually to beta track and finally switching back to the beta track in my script.

Google Api Error: multiApkShadowedActiveApk: Version 89 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.

@markpar

This comment has been minimized.

Show comment
Hide comment
@markpar

markpar May 11, 2017

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?

markpar commented May 11, 2017

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?

@hypery2k

This comment has been minimized.

Show comment
Hide comment
@hypery2k

hypery2k May 11, 2017

you have to have a version in beta. Just move a new alpha to beta

hypery2k commented May 11, 2017

you have to have a version in beta. Just move a new alpha to beta

@gmarques33

This comment has been minimized.

Show comment
Hide comment
@gmarques33

gmarques33 May 12, 2017

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.

I'm facing the same issue. I had to manually upload a new version to Alpha and then promote to beta. Now my upload via fastlane is working again.

gmarques33 commented May 12, 2017

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.

I'm facing the same issue. I had to manually upload a new version to Alpha and then promote to beta. Now my upload via fastlane is working again.

@arohim

This comment has been minimized.

Show comment
Hide comment
@arohim

arohim May 22, 2017

I'm facing the same issue.

arohim commented May 22, 2017

I'm facing the same issue.

@capyvara

This comment has been minimized.

Show comment
Hide comment
@capyvara

capyvara May 23, 2017

Contributor

@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:

image

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.

Contributor

capyvara commented May 23, 2017

@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:

image

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.

@capyvara capyvara referenced this issue May 23, 2017

Merged

supply: Add support for apk superseded #9250

4 of 4 tasks complete
@capyvara

This comment has been minimized.

Show comment
Hide comment
@capyvara

capyvara May 24, 2017

Contributor

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.

Contributor

capyvara commented May 24, 2017

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.

@arohim

This comment has been minimized.

Show comment
Hide comment
@arohim

arohim May 25, 2017

@capyvara

Nice!!, Can't wait to test it.

Thank you.

arohim commented May 25, 2017

@capyvara

Nice!!, Can't wait to test it.

Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.