measure-builds-gradle-plugin
measure-builds-gradle-plugin copied to clipboard
Do not crash if `buildMetricsPreparedAction` null
User reports that sometimes they experience lateinit property buildMetricsPreparedAction has not been initialized error, fixed by Android Studio/IntelliJ Gradle sync.
The root cause of this problem is not known at this moment, but it'll be better to warn client about it, rather than crashing the build.
It is a somewhat challenging problem. When it occurs, we can work around this by using rm -rf .gradle/configuration-cache as mentioned in the documentation ( https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:usage:invalidate ).
I hit this issue fairly often, and feel like it happens when I run a task which has all the tasks already cached (so nothing actually gets run).
I sort it out by picking a task and running with the --rerun-tasks flag in gradle.
Is there a github issue for this?
@wzieba Is there a reason not to merge this? Would greatly appreciate a new release with this change in
hi there 👋 There's no actual reason to not merge this - I can do this. I thought I'll be able to address this issue in a more meaningful way than this, but for now, I think I agree it's better to not crash the plugin.
Thanks @takahirom for the suggestion. Whenever I'll have some time, I'll try to follow up on this to find some satisfying solution.
@jd565 Plugin in version 3.1.1 is now available via Gradle's plugin portal