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

Way to verify Service account JSON access before creating app #793

Closed PhilipSA closed 4 years ago

PhilipSA commented 4 years ago

For existing apps you can simply run the bootstrap gradle task to verify access. But if the app is not uploaded yet you will get 404.

Execution failed for task ':generateEditForFriskDotServiceaccountDotTest'.
> A failure occurred while executing com.github.triplet.gradle.play.tasks.GenerateEdit$Generator
   > 404 Not Found
     {
       "code" : 404,
       "errors" : [ {
         "domain" : "global",
         "message" : "Package not found: frisk.serviceaccount.test.",
         "reason" : "notFound"
       } ],
       "message" : "Package not found: frisk.serviceaccount.test.",
       "status" : "NOT_FOUND"
     }

There has to be a way to verify this before i upload the customers app. It is a real pain to try and convince the customer to fix any issues when the app is published.

Would be great if documentation could be added for the quickstart step.

SUPERCILEX commented 4 years ago

Nope, we can't do anything about that:

You can only use this API to make changes to an existing app (that has at least one APK uploaded); thus, you will have to upload at least one APK through the Play Console before you can use this API. Furthermore, you cannot use this API to change an app's state from "published" to "unpublished", or to fill out the legal consents required for publishing. To publish the app, you have to use the Play Console.

Though the fact that you got a notFound exception instead of some authorization error should mean you're authed correctly.

PhilipSA commented 4 years ago

Nope, we can't do anything about that:

You can only use this API to make changes to an existing app (that has at least one APK uploaded); thus, you will have to upload at least one APK through the Play Console before you can use this API. Furthermore, you cannot use this API to change an app's state from "published" to "unpublished", or to fill out the legal consents required for publishing. To publish the app, you have to use the Play Console.

Though the fact that you got a notFound exception instead of some authorization error should mean you're authed correctly.

If anyone else finds this and has the same issue; I got notFound exception regardless if the .json had access or not. So do not rely on it

SUPERCILEX commented 4 years ago

Maybe you can try publishing the app and checking that error message? It won't work of it's not on the play store, but it should still tell you that or fail with an authorization error.