Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.1k stars 340 forks source link

403 Forbidden upon Committing changes #873

Closed raphael-anydo closed 3 years ago

raphael-anydo commented 3 years ago

Describe the bug

Hello. I was using v2.0.0 until now, and very recently upgraded to v2.6.2, because of gradle plugin upgrade. I left the config unchanged in my project:

play {
    serviceAccountEmail = 'xxx'
    serviceAccountCredentials = file('xxx')
    track = 'alpha'
}

now when I try to publish I get the following:

> Task :app:publishVanillaRegularReleaseBundle
Starting App Bundle upload: /home/travis/build/xxx/.../build/outputs/bundle/vanillaRegularRelease/xxx-regular-release.aab
Uploading App Bundle: 23% complete
Uploading App Bundle: 46% complete
Uploading App Bundle: 69% complete
Uploading App Bundle: 92% complete
App Bundle upload complete
Starting mapping file upload: /home/travis/build/xxx/build/outputs/mapping/vanillaRegularRelease/mapping.txt
Uploading mapping file: 28% complete
Uploading mapping file: 56% complete
Uploading mapping file: 84% complete
Mapping file upload complete
Updating [completed] release (com.xxx:[16847]) in track 'alpha'
> Task :commitEditForComDotXXX FAILED
Committing changes
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':commitEditForComDotXXX'.
> A failure occurred while executing com.github.triplet.gradle.play.tasks.CommitEdit$Committer
   > 403 Forbidden
     {
       "code" : 403,
       "errors" : [ {
         "domain" : "global",
         "message" : "Release artifacts require permissions that are missing from permission declaration.",
         "reason" : "forbidden"
       } ],
       "message" : "Release artifacts require permissions that are missing from permission declaration.",
       "status" : "PERMISSION_DENIED"
     }

How To Reproduce

Upgrade from v2.0.0 to v2.6.2, launch publish task.

Versions

Tasks executed

publishVanillaRegularReleaseBundle

Expected behavior

no error.

Additional context (if a crash, provide stack trace)

Extra note: I also tried with version 2.4.2 of gpp and still have the same issue. Thanks you for any information or any clue on solving this issue.

SUPERCILEX commented 3 years ago

Do you have these permissions in the Play Console? https://github.com/Triple-T/gradle-play-publisher/blob/master/assets/min-perms.png

raphael-anydo commented 3 years ago

@SUPERCILEX Thanks for your answer. According to the administrator, yes, these permissions are set in the play console. Edit: I confirm these permissions are correctly set. Edit II: uploading the app manually through the play console UI works.

raphael-anydo commented 3 years ago

@SUPERCILEX for some strange reason, it seems to work now after removing a dependency to the google-api-client with a specific version which was previously used: classpath 'com.google.api-client:google-api-client:1.25.0'

if it can help someone, if you have a dependency to the google api client, you should probably check that it's the same version as the version used in gpp, or it might cause gpp to use that api client instead of the one it's intended to use.