Gradle-play-publisher: build fails on assemble - "application not found on play (404)"

Created on 18 Oct 2018  路  3Comments  路  Source: Triple-T/gradle-play-publisher

Describe the bug

When calling gradlew assemble from buildscript with multiple flavors, the build fails in ':app:processDevReleaseMetadata', due to a call to https://www.googleapis.com/androidpublisher/v3/applications/>flavor-package

Is this intended behavior or a bug, and is there a way to configure my way out of this problem?

Thanks in advance :)

To Reproduce

run assemble on a project with diffferent flavors which isnt published on play.

Versions

Expected behavior

I dont expect your plugin to run on tasks which arent release-related.

Additional context

POST https://www.googleapis.com/androidpublisher/v3/applications/com....../edits
Accept-Encoding: gzip
Authorization:
User-Agent: gradle-play-publisher Google-API-Java-Client Google-HTTP-Java-Client/1.23.0 (gzip)
Content-Encoding: gzip
Content-Length: 20

15:11:25.069 [INFO] [com.google.api.client.http.HttpTransport] curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: ' -H 'User-Agent: gradle-play-publisher Google-API-Java-Client Google-HTTP-Java-Client/1.23.0 (gzip)' -H 'Content-Encoding: gzip' -d '@-' -- 'https://www.googleapis.com/androidpublisher/v3/applications/c
om..../edits' << $$$
15:11:25.127 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@52f17bac10 pairs: {POST /androidpublisher/v3/applications/com.brobizz.selfservice.dev/edits HTTP/1.1: null}{Accept-Encoding: gzip}{Authorization: Bearer ......}{User-Agent: gradle-play-publisher Google-API-Java-Client Google-HTTP-Java-Client/1.23.0 (gzip)}{Content-Encoding: gzip}{Host: www.googleapis.com}{Accept: text/html, image/gif, image/jpeg, ; q=.2, */; q=.2}{Connection: keep-alive}{Content-type: application/x-www-form-urlencoded}{Content-Length: 20}
15:11:25.291 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@5ee2b2bd14 pairs: {null: HTTP/1.1 404 Not Found}{Vary: Origin}{Vary: X-Origin}{Content-Type: application/json; charset=UTF-8}{Content-Encoding: gzip}{Date: Wed, 17 Oct 2018 13:11:27 GMT}{Expires: Wed, 17 Oct 2018 13:11:27 GMT}{Cache-Control: private, max-age=0
}{X-Content-Type-Options: nosniff}{X-Frame-Options: SAMEORIGIN}{X-XSS-Protection: 1; mode=block}{Server: GSE}{Alt-Svc: quic=":443"; ma=2592000; v="44,43,39,35"}{Transfer-Encoding: chunked}
15:11:25.292 [INFO] [com.google.api.client.http.HttpTransport] -------------- RESPONSE --------------
HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Alt-Svc: quic=":443"; ma=2592000; v="44,43,39,35"
Server: GSE
X-Content-Type-Options: nosniff
Date: Wed, 17 Oct 2018 13:11:27 GMT
X-Frame-Options: SAMEORIGIN
Cache-Control: private, max-age=0
Content-Encoding: gzip
Vary: X-Origin
Vary: Origin
Expires: Wed, 17 Oct 2018 13:11:27 GMT
X-XSS-Protection: 1; mode=block
Content-Type: application/json; charset=UTF-8

15:11:25.293 [INFO] [com.google.api.client.http.HttpTransport] Total: 326 bytes
15:11:25.293 [INFO] [com.google.api.client.http.HttpTransport] {
"error": {
"errors": [
{
"domain": "global",
"reason": "applicationNotFound",
"message": "No application was found for the given package name.",
"locationType": "parameter",
"location": "packageName"
}
],
"code": 404,
"message": "No application was found for the given package name."
}
}

15:11:25.295 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Execute process for :app:processDevReleaseMetadata'
15:11:25.295 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
15:11:25.295 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:processDevReleaseMetadata'
15:11:25.295 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:processDevReleaseMetadata'
15:11:25.295 [null] [org.gradle.internal.progress.DefaultBuildOperationExecutor]
15:11:25.295 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Task :app:processDevReleaseMetadata' completed
15:11:25.295 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :app:processDevReleaseMetadata (Thread[Daemon worker Thread 9,5,main]) completed. Took 0.288 secs.
15:11:25.296 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.36 completed (1 worker(s) in use)
15:11:25.296 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 9: released lock on root.1.36
15:11:25.296 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 9: released lock on :
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 9,5,main]] finished, busy: 17.014 secs, idle: 55.606 secs
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 6,5,main]] finished, busy: 0.0 secs, idle: 1 mins 12.62 secs
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 2,5,main]] finished, busy: 0.0 secs, idle: 1 mins 12.621 secs
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 5,5,main]] finished, busy: 0.0 secs, idle: 1 mins 12.62 secs
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 7,5,main]] finished, busy: 0.0 secs, idle: 1 mins 12.62 secs
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 3,5,main]] finished, busy: 55.295 secs, idle: 17.326 secs
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':',5,main]] finished, busy: 0.0 secs, idle: 1 mins 12.621 secs
15:11:25.296 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 4,5,main]] finished, busy: 0.0 secs, idle: 1 mins 12.621 secs
15:11:25.299 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:processDevReleaseMetadata'.
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > No application found for the package name com.brobizz.selfservice.dev. The first version of your app must be uploaded via the Play Store console.
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
15:11:25.301 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
15:11:25.302 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
15:11:25.302 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 1m 16s

bug

Most helpful comment

@SUPERCILEX I think we need to be smarter here. The flavor that's failing now isn't supposed to published. Thus, there will never be a play store entry. So basically, applying our plugin now fails the assemble task for flavors like that. This should never happen.

All 3 comments

Please set resolutionStrategy = "fail" or publish the first alpha of your app to the Play Console manually.

@SUPERCILEX I think we need to be smarter here. The flavor that's failing now isn't supposed to published. Thus, there will never be a play store entry. So basically, applying our plugin now fails the assemble task for flavors like that. This should never happen.

@bhurling Thats correct and presumably a common scenario.
Thx for fast response 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bunjix picture bunjix  路  5Comments

kristiyanP picture kristiyanP  路  4Comments

siddharthkhindri picture siddharthkhindri  路  5Comments

SUPERCILEX picture SUPERCILEX  路  6Comments

ToxicBakery picture ToxicBakery  路  4Comments