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

Q: Bumping the minSdkVersion #830

Closed ggajews closed 4 years ago

ggajews commented 4 years ago

Recently we bumped minSdkVersion in our application. Running the script now produces a very cryptic response from API

> A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishApk$Processor
   > There was a failure while executing work items
      > A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishApk$ApkUploader
         > 403 Forbidden
           {
             "code" : 403,
             "errors" : [ {
               "domain" : "global",
               "message" : "APK is not a valid ZIP archive",
               "reason" : "forbidden",
               "debugInfo" : "detail: \"[ORIGINAL ERROR] generic::permission_denied: com.google.apps.framework.request.ForbiddenException: APK is not a valid ZIP archive [google.rpc.error_details_ext] { message: \\\"APK is not a valid ZIP archive\\\" }\"\n"
             } ],
             "message" : "APK is not a valid ZIP archive",
             "status" : "PERMISSION_DENIED"
           }

I tried to upload the produced APK file manually and it went smoothly. Do you think the issue is that this release requires manual approval in Google Play Console?

SUPERCILEX commented 4 years ago

I don't control the API. The best I can offer is to make sure the uploaded APK in Gradle is the same one you uploaded to the console (check the printed file location and make sure you don't have other tasks messing with it).

ggajews commented 4 years ago

I know, I was just looking for the confirmation that this might be a cause (play console API is not very verbose when it comes to errors). Anyways I guess we will learn with the next release. Thanks for this awesome plugin!

ggajews commented 4 years ago

Update for people that might search for this issue, indeed that was the case. The subsequent release went smoothly!

ol-v-er commented 4 years ago

Just had the same problem. On the same project, this morning publication was OK, this afternoon KO. Manual upload with the PlayStore console with exact same APK is OK. Automatic update after this manual update did not work.

I suspect the PlayStore to have, as often, a problem.

Execution failed for task ':app:publishProdReleaseApk'. A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishApk$Processor There was a failure while executing work items A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishApk$ApkUploader 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "APK is not a valid ZIP archive", "reason" : "forbidden", "debugInfo" : "detail: \"[ORIGINAL ERROR] generic::permission_denied: com.google.apps.framework.request.ForbiddenException: APK is not a valid ZIP archive [google.rpc.error_details_ext] { message: \\"APK is not a valid ZIP archive\\" }\"\n" } ], "message" : "APK is not a valid ZIP archive", "status" : "PERMISSION_DENIED" } Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Updating the Gradle Play Publisher plugin from 2.6.1 to 2.8.0 (and updating the Gradle dependency to 6.5.1) did not fixed the problem.

sudansh commented 4 years ago

Facing the same issue with 2.8.0

{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "APK is not a valid ZIP archive",
    "reason" : "forbidden",
    "debugInfo" : "detail: \"[ORIGINAL ERROR] generic::permission_denied: com.google.apps.framework.request.ForbiddenException: APK is not a valid ZIP archive [google.rpc.error_details_ext] { message: \\\"APK is not a valid ZIP archive\\\" }\"\n"
  } ],
  "message" : "APK is not a valid ZIP archive",
  "status" : "PERMISSION_DENIED"
}