Status Update
Comments
hu...@google.com <hu...@google.com> #2
I've confirmed that the following steps reproduce the issue:
git clone https://github.com/androidx/androidx.git
git checkout 1f6e0374e8490db07e90df6d6f883cf77cbf25fb
./gradlew :room:integration-tests:room-testapp:mapWithExpandProjectionDebugAndroidTestSourceSetPaths
(or./gradlew :room:integration-tests:room-testapp:dependencies
)
The workaround is to disable --configure-on-demand
: -Dorg.gradle.configureondemand=false
.
Root cause:
- AGP requires that
AnalyticsConfiguratorService#getVariantBuilder
be called only during the configuration phase. - However, with
--configure-on-demand
, projects may be configured during the execution phase, which may callAnalyticsConfiguratorService#getVariantBuilder
and violate the above requirement.
@Bingran: Is it possible for AnalyticsConfiguratorService
to support --configure-on-demand
?
bi...@google.com <bi...@google.com> #3
I can first mitigate this issue by converting errors from exceptions to warnings. Hung, I am not sure we would expect projects to be configured during the execution phase in case of configuration on demand.
For a proper fix, I am thinking we might need to fix the task or how the project is setup(not sure if there is coupling issue AnalyticsConfiguratorService
which is not designed to work in configuration time.
ju...@target.com <ju...@target.com> #4
If the solution is to tell people to decouple their projects they may do that eventually - until they do solve that problem most people will likely just disable configuration on demand as mentioned above
Or they manually modify their .android/analytics.settings file to opt-out and prevent write access so Android toolchain can't update it again. I don't think this is really a desirable path since I'm assuming this data is helpful to upstream teams - and if that's the case we want to share it (where it's not disruptive to our team hitting build failures)
If a task level fix is possible I think that would ideal where the alternatives are either a performance hit from disabling configuration on demand or data loss from people choosing not to participate due to being impacted by something they aren't entirely sure how to fix
Right now we see ~80 of these per week
ju...@target.com <ju...@target.com> #5
to...@gmail.com <to...@gmail.com> #6
For me, it happens when I'm trying to print dependencies via dependencies
task.
And -Dorg.gradle.configureondemand=false
helped me.
bi...@google.com <bi...@google.com>
hu...@google.com <hu...@google.com> #7
FYI: With
Description
gradle version 8.0 AGP version: 8.0.0-beta03
When trying to run the task which has broken dependencies reported in b/270730589 , I get a different errror where Android library plugin fails to apply.
In all likelihood, these are related (missing task dependencies) but filing them separately as I'm not sure if they are related or not.
to reproduce:
checkout androidx via githubhttps://github.com/androidX/androidx (head commit if needed:
1f6e0374e8490db07e90df6d6f883cf77cbf25fb
)stacktrace: