play-services-plugins icon indicating copy to clipboard operation
play-services-plugins copied to clipboard

Gradle Execution optimizations are disabled with AGP 7.1.0-beta01 when the Google Services Plugin is applied

Open eygraber opened this issue 4 years ago • 4 comments

Using com.google.gms:google-services:4.3.10 together with AGP 7.1.0-beta01 and Gradle 7.2 I get the following warning:

Execution optimizations have been disabled for task ':app:mergeDevReleaseResources' to ensure correctness due to the following reasons: - Gradle detected a problem with the following location: '/home/eli/workspace/myapp/app/build/generated/res/google-services/dev/release'. Reason: Task ':app:mergeDevReleaseResources' uses this output of task ':app:processDevReleaseGoogleServices' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

eygraber avatar Oct 15 '21 01:10 eygraber

https://issuetracker.google.com/issues/207838392 Also created a corresponding AGP issue

dsvoronin avatar Nov 26 '21 19:11 dsvoronin

I'm having the same issue here: https://github.com/google/play-services-plugins/issues/210 Apps crash at startup as a result.

auras avatar Dec 15 '21 12:12 auras

https://issuetracker.google.com/issues/207838392 Also created a corresponding AGP issue

Also happening with AGP 7.0.x

dsvoronin avatar Dec 15 '21 12:12 dsvoronin

We have the same issue, but it happens very rarely and randomly.

But I think that solution is clear, not?

Gradle detected a problem with the following location: '/home/tcagent/.buildAgent/work/master/cleaner/app/build/generated/res/google-services/defaultBackendTest/debug'. Reason: Task ':app:mergeDefaultBackendTestDebugResources' uses this output of task ':app:processDefaultBackendTestDebugGoogleServices' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem

So should be enough to declare dependency between mergeResources and processGoogleServices, to be sure, that order of it will be always deterministic, now it is somehow random.

Maybe using org.gradle.parallel=false would solve it, but it will probably also increase the build time. I did not try it.

tprochazka avatar Jan 20 '22 13:01 tprochazka

Fixed by https://github.com/google/play-services-plugins/pull/232

eygraber avatar Jan 20 '23 18:01 eygraber