gradle-play-publisher: Receive 403 error when trying to publish to other channel

Hi there,

Thanks for the great plugin beforehand.

We have been using the play publisher plugin and works great deploying to ‘alpha’ channel on Google Play Store. However we just discover when we try to change to publish certain version to ‘beta’ channel, we receive 403 error. The error is like below

> com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
  {
    "code" : 403,
    "errors" : [ {
      "domain" : "androidpublisher",
      "message" : "Version ???? of this app can not be downloaded by any devices as 
they will all receive APKs with higher version codes.",
      "reason" : "multiApkShadowedActiveApk"
    } ],
    "message" : "Version ???? of this app can not be downloaded by any devices 
as they will all receive APKs with higher version codes."
  }

Is there any workaround to publish from ‘alpha’ to ‘beta’ ?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 24 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I think the plugin need an update. I have the same problem.

Currently our app has only one version active for all users (1700), we have been using the alpha and beta channels before but we uploaded the (final) “1700” directly to production and therefore disabled the beta channel. (We did the same to beta/alpha earlier when we pushed “1645” directly to beta instead of pushing it to alpha first, which is why our alpha version is even older than the beta version.)

In the “Play Console” Android App by Google it currently looks like this: production-beta-alpha-app The “Google Play Developer Console” (website) looks like this (section ~“manage versions”) production-beta-alpha-website

Until now we always uploaded APKs manually but we now want to start using gradle-play-publisher. I am now testing version 1.2.0-beta2 with this settings trying to upload version “1702” to alpha:

play {
    track = 'alpha'
    untrackOld = true
    jsonFile = file('keys.json')
}

Edit: Initially I only had jsonFile definded and the error occured, so I added track and untrackOld for testing but it still doesn’t work (same error). … but we currently get this error:

{
  "code" : 403,
  "errors" : [ {
    "domain" : "androidpublisher",
    "message" : "Version 1645 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.",
    "reason" : "multiApkShadowedActiveApk"
  } ],
  "message" : "Version 1645 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes."
}

I don’t know why google’s api is complaining about the outdated beta channel apk (1645) which already is inactive. Is there a proper way to work around this or do i have to manually upload a “1701” to beta in order to make gradle-play-publisher able to upload the “1702” version to alpha?

Also: the readme states we can use untrackOld = true, your comment said untrackOld true. Do both ways work? Which one is preferred?

I just tried to do the following steps using the web interface:

  1. Upload an APK to alpha with version code 42
  2. Upload an APK to beta with version code 43

The web interface does not let me apply that configuration with basically the same message (version 42 can’t be downloaded by any device). So as I see it, the 403 response is more or less the expected behaviour for a configuration like that. I don’t agree with that behaviour but Google obviously assumes that Alpha Testers are a subset of Beta Testers.

There are three things we can do to tackle that issue:

  1. Wrap that error message into something more useful like “Did you forget to deactivate your APK in the alpha/beta/rollout track?”
  2. Provide dedicated tasks to deactivate the APK on alpha/beta/rollout track. I’d rather not automatically deactivate other tracks because that might break other people’s tests.
  3. File an issue to explains that Alpha Testers are not necessarily a subset of Beta Testers and thus their assumption “App cannot be downloaded by any device” is not entirely true

Thank you for your fast reply. We managed to get it to work without the need to publish a new version (causing updates for the users) to production or beta. Here our solution just in case someone else runs into the same issue.

There was a way in the webinterface to update the beta channel from the outdated 1645 to 1700, so it would equalize with production where we were already using 1700: “Manage Beta Version” -> “Create Version” -> “add APK from library” (translated from German “Beta-Version Verwalten” -> “Version erstellen” -> “APK aus der Bibliothek hinzufügen”)

So we got into this state: beta-equals-production

After that we were able to use gradle-play-publisher to update the alpha channel directly from the outdated 1610 to the latest 1702 (newer than beta/production)

End result: alpha-upload-successful The Android Play Developer app now shows it like this: (After the inactive beta 1645 was updated to the 1700 from prodution the beta channel disappered from this view.) no-beta-listed-in-app

Good summary of the problem. Thank you.

I would say the 3rd option is impossible. Even though some people would not prefer Alpha Testers are a subset of Beta, most projects would prefer that I think. At least Google thinks that way. And changing it at that point may not be possible at all.

I would go for the 2nd option. Automatically doing it is I think too much. But it can be provided as an option. And a task to deactivate an APK in the track would be really helpful.