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.13k stars 341 forks source link

A failure occurred while executing PublishBundle$BundleUploader #1044

Closed bobcleaves closed 2 years ago

bobcleaves commented 2 years ago

Describe the bug

When executing the play task below, the publishBundle task results in a 403 permssion denied error. We have setup a service account and linked it to our play store account and published the credentials file (GPP_CREDENTIALS) to our S3 directory and are accessing this during the build process. We have also enabled the google play android developer API.

How To Reproduce

execute gradle task;play { def gppCredentials = project.findProperty('GPP_CREDENTIALS') ?: System.getenv('GPP_CREDENTIALS') def suffix = project.findProperty('VERSION_EXT') ?: '' def name = project.version + suffix

serviceAccountCredentials.set(file(gppCredentials))
defaultToAppBundles.set(true)

// Can override on CLI with --release-name, ex. to append "-internal", but should have no need
// since our CI sets VERSION_EXT for us.
releaseName.set(name)

// Can override on CLI, ex. --release status "draft", but really never should.
// Note "completed" is the default but "draft: makes more sense for us.
releaseStatus.set(ReleaseStatus.DRAFT)

// Override on the CLI using --track and passing "internal" (dev build) or "alpha" (release build).
track.set("internal")

}

Versions

AppLovin Quality Service Plug-in for Gradle and Android Studio Version 4.3.1 --- com.applovin.quality:AppLovinQualityServiceGradlePlugin:4.3.1

+--- com.android.tools.build:gradle:7.1.2 | | --- com.android.tools.build:gradle:3.1.4 -> 7.1.2 (*)

Tasks executed

publishBundle.

Expected behavior

An Android bundle (.aab file) is pushed to the google play store.

Additional context (if a crash, provide stack trace)

A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishBundle$Processor There was a failure while executing work items A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishBundle$BundleUploader 403 Forbidden POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.****.client/edits { "code": 403, "errors": [ { "domain": "global", "message": "The caller does not have permission", "reason": "forbidden" } ], "message": "The caller does not have permission", "status": "PERMISSION_DENIED" }

SUPERCILEX commented 2 years ago

Step 6: https://github.com/Triple-T/gradle-play-publisher#service-account

bobcleaves commented 2 years ago

issue resolved by creating a new key file using the service account associated with the already associated google play account.