I'm getting a timeout when uploading the .apk
-------------- REQUEST --------------
PUT https://www.googleapis.com/upload/androidpublisher/v2/applications/xxx/edits/xxx/apks?uploadType=resumable&upload_id=xxx
Accept-Encoding: gzip
Authorization: <Not Logged>
Content-Range: bytes 0-3567269/3567270
User-Agent: Google-HTTP-Java-Client/1.20.0 (gzip)
Content-Type: application/vnd.android.package-archive
Content-Length: 3567270
curl -v --compressed -X PUT -H 'Accept-Encoding: gzip' -H 'Authorization: <Not Logged>' -H 'Content-Range: bytes 0-3567269/3567270' -H 'User-Agent: Google-HTTP-Java-Client/1.20.0 (gzip)' -H 'Content-Type: application/vnd.android.package-archive' -d '@-' -- 'https://www.googleapis.com/upload/androidpublisher/v2/applications/xxx/edits/xxx/apks?uploadType=resumable&upload_id=xxx' << $$$
Total: 3谩567谩270 bytes (logging first 16谩384 bytes)
:app:publishApkRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:publishApkRelease'.
> java.net.SocketTimeoutException: Read timed out
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:publishApkRelease'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.api.UncheckedIOException: java.net.SocketTimeoutException: Read timed out
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:78)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 60 more
Caused by: java.net.SocketTimeoutException: Read timed out
at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:94)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:972)
at com.google.api.client.googleapis.media.MediaHttpUploader.executeCurrentRequestWithoutGZip(MediaHttpUploader.java:545)
at com.google.api.client.googleapis.media.MediaHttpUploader.resumableUpload(MediaHttpUploader.java:417)
at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:336)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:427)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$execute.call(Unknown Source)
at de.triplet.gradle.play.PlayPublishApkTask.publishApk(PlayPublishApkTask.groovy:24)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
... 67 more
BUILD FAILED
Total time: 41.497 secs
D:\> gradlew -v
------------------------------------------------------------
Gradle 2.10
------------------------------------------------------------
Build time: 2015-12-21 21:15:04 UTC
Build number: none
Revision: 276bdcded730f53aa8c11b479986aafa58e124a6
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.7.0_79 (Oracle Corporation 24.79-b02)
OS: Windows 8.1 6.3 amd64
For me it works when publishing in alpha but when publishing in beta it fails with the above error
I have the same problem.
I have exactly same problem. Tried uploading on alpha and beta while having and not having active artifacts in those tracks.
Anyone solved it or found another solution? It seems there is no reasonable alternative for this plugin available for my ci (circleci).
I'm also facing an intermittent timeout when uploading an APK to google play. Most of the time it works fine but once and a while I'll get the same error as seen above.
Is there a timeout value that could be exposed in this library to allow more time for the upload to complete? Just being able to increase the time allowed might work for me -- if that's possible to do
It looks like the timeout needs to be set appropriately:
https://developers.google.com/api-client-library/java/google-api-java-client/errors
It's been several months since the pull request above was submitted.. is the owner able to review & merge it? This issue has been fairly frustrating as it always seems to happen when I need a build to get uploaded to google play.
I think I can just use the forked version instead with jitpack and maybe I'll give that a try. Anyone else using it? Here's what I'll test (it'll take a while to really test since we have a build server doing the actual uploading)
https://github.com/lswith/gradle-play-publisher
[build.gradle]
apply plugin: 'com.github.triplet.play'
buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.github.lswith:gradle-play-publisher:1.2.0'
}
}
...
play {
... no changes here ...
}
rats.. worked on 2 uploads but failed on the 3rd
* What went wrong:
Execution failed for task ':my-app:publishApkAppNameRelease'.
> java.net.SocketTimeoutException: Read timed out
@lswith - do you know what the previous default timeout was before your change? Is the default now 3 minutes? I didn't change anything but I can.. have you had any issues w/the default?
I just realized that's not the correct syntax for jitpack.io - to use the correct version is should be this:
classpath 'com.github.lswith:gradle-play-publisher:38e8e37328'
I found that out when trying to change the timeout to 5 minutes..
I'll update if I have any more socket timeout issues
ok - sorry for all of the updates.. last one. Build failed with following:
* What went wrong:
Execution failed for task ':my-app:publishApkMyAppRelease'.
> No signature of method: static de.triplet.gradle.play.AndroidPublisherHelper.setHttpTimeout() is applicable for argument types: (com.google.api.client.googleapis.auth.oauth2.GoogleCredential, java.lang.Integer) values: [com.google.api.client.googleapis.auth.oauth2.GoogleCredential@225b9084, ...]
guess I just need to wait for this PR to get merged?
FYI - I think I fixed the issue above and I submitted a tiny pull request for it:
https://github.com/lswith/gradle-play-publisher/pull/1
However -- the ironic thing is - I still got the SocketTimeoutException when trying to upload to Google Play! I added --info to the gradlew command and it seemed like that Exception was happening right after trying to upload the apk file (ie: not a timeout issue).
So, I'm not certain this will make a difference.. maybe the issue is just Google Play API getting busy and not accepting connections at times? If that's the case I might just have to check for this issue in my build server and try again a few times..
Anyway - I'm posting all of this in case someone else has an idea or suggestions
This becomes relevant with App Bundles which require more processing from Google Play and thus fail basically everytime. We'll increase the timeout to a minute or something (current is 20 seconds).
Is this worth adding a configuration option, since bandwidth and processing can be different for different projects?
It would be nice to let devs hook into the network stack somehow. Otherwise, I feel like we'll just be cluttering the config. If nothing else, we could bump it up to several minutes which should be more than enough.
How could we provide a hook like that?
Absolutely no clue 馃槀
I'd recommend to just bump up the socket timeout internally because we kind of know that our uploads are rather heavy. No need for an additional config flag is say
SGTM ! See #272
Yesterday (and for monthes) it was good, but today I get the same error
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':publishDevelReleaseApk'.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.net.SocketTimeoutException: Read timed out
I use Gradle Play Publisher: 2.0.0