Gradle-play-publisher: Non-existent play folder causes build to fail

Created on 30 Jun 2018  路  7Comments  路  Source: Triple-T/gradle-play-publisher

If the 'release-notes' folder does not exist the build will fail while doing the publish task to publish an apk/bundle.

Making releaseNotesDir in PlayPublishPackageBase be nullable again seems to make it work. It was intentionally removed here: https://github.com/Triple-T/gradle-play-publisher/commit/525b13203462e3417c68d5e3a8d158c5cf2d073d#diff-50be7e56abb0dd9419edb1f897d71a58

bug

All 7 comments

@knordbo please share _error logs_. 馃槃 Those changes actually allow a non-existent release-notes dir.

Sure, no worries :)

Config:

play {
    serviceAccountCredentials = file("service-account.json")
    track = 'internal'
}

Error logs when running ./gradlew clean publishRelease --stacktrace

> Task :app:publishReleaseApk FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':app:publishReleaseApk'.
> Directory '/Users/username/src/foo/app/build/generated/gpp/release/res/release-notes' specified for property 'releaseNotesDir$plugin' does not exist.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskValidationException: A problem was found with the configuration of task ':app:publishReleaseApk'.
        at org.gradle.api.internal.tasks.TaskValidationContext$Severity$2.report(TaskValidationContext.java:55)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:596)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.InvalidUserDataException: Directory '/Users/username/src/foo/app/build/generated/gpp/release/res/release-notes' specified for property 'releaseNotesDir$plugin' does not exist.
        at org.gradle.api.internal.tasks.TaskValidationContext$Severity$2.report(TaskValidationContext.java:52)
        ... 25 more


* Get more help at https://help.gradle.org

BUILD FAILED in 28s

@knordbo Thanks! 鉂わ笍 And yeah, you're definitely using an old version of our dev builds. Try this hash: com.github.Triple-T:gradle-play-publisher:42ffe9922c.

PS: let me know if you need help setting up https://jitpack.io.

Same result unfortunately. Odd that it doesn't reproduce on your side. If you suspect something is ill in my setup don't worry about this issue for now, I've got a workaround for now which is making it nullable :)

We got rid of the nullable thing because it causes non-deterministic behavior. Gradle is supposed to be checking that stuff for you, so if you do it yourself, it might consider the task up-to-date when it isn't or it will think there aren't release notes when you did in fact add them.

If you have a sample project I could play with, I'd love to help out.

Sure, if you check out this branch: https://github.com/knordbo/satis/tree/reproduce-play-publish-error
./gradlew clean publishRelease
It is currently working by adding the null workaround, but if you change the version back to the jitpack hash you provided above in versions.gradle https://github.com/knordbo/satis/blob/reproduce-play-publish-error/versions.gradle#L89 you will get a failure.

Btw, keep in mind that I just added dummy signing files and google services json etc so you will probably get a HTTP 403 when trying to publish, but the release-notes error will happen before that anyways. Let me know if you can reproduce it with that repo :)

Oh, nailed it! We don't handle the case where there's no play folder _at all_. Will fix. 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

siloebb picture siloebb  路  5Comments

daniele-pecora picture daniele-pecora  路  5Comments

lordcodes picture lordcodes  路  5Comments

zhelanov picture zhelanov  路  6Comments

MaTriXy picture MaTriXy  路  4Comments