Gradle Execution optimizations are disabled with AGP 7.1.0-beta01 when the Google Services Plugin is applied
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.
https://issuetracker.google.com/issues/207838392 Also created a corresponding AGP issue
I'm having the same issue here: https://github.com/google/play-services-plugins/issues/210 Apps crash at startup as a result.
https://issuetracker.google.com/issues/207838392 Also created a corresponding AGP issue
Also happening with AGP 7.0.x
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.
Fixed by https://github.com/google/play-services-plugins/pull/232