Status Update
Comments
bi...@google.com <bi...@google.com> #2
Bingran, can you please take a look?
From the stacktrace, it seems like the issue is triggered during the native model building (com.android.build.gradle.internal.ide.v2.NativeModelBuilder.buildAll(NativeModelBuilder.kt:104
), and it seems like .kts
build files are used (see prepareKotlinBuildScriptModel
task running).
Nick, does using:
- Android Studio: 2021.3.1 Canary 7
- AGP: 7.1.2
- Gradle: 7.2
also fail?
sg...@google.com <sg...@google.com> #3
I can't seem to reproduce the error now, but that may be due to project changes, or perhaps cache invalidation etc fixed it. However, given the error, perhaps there is still a bug there.
I only use build.gradle files, not kts, so any kotlin build files would be internal. However, the app uses Kotlin.
Gradle 7.2 worked with AGP 7.1.2, just 7.4 that had the problem.
bi...@google.com <bi...@google.com> #4
The error is thrown when analytics is queried in NativeModelBuilder
but AnalyticsService
doesn't seem to have been configured which is the reason why we get "no value available" error from AnalyticsService.reconstructProfileBuilder(AnalyticsService.kt:199
. Is is not obvious why AnalyticsService is not configured in a sync build. Due to it cannot be reproduced consistently, I think we should downgrade the priority and upgrade it when we see similar issues.
bi...@google.com <bi...@google.com> #5
I am running into this error again. Gradle 7.4 or 7.3.3, AGP 7.2.0, AS Dolphin | 2021.3.1 Beta 1. What can I try to resolve it?
ga...@google.com <ga...@google.com> #6
Does it happen consistently? like every time you open the project?
ch...@google.com <ch...@google.com> #7
Yes. I can't resolve it after updating Gradle versions. I think perhaps it was repeatable before I had just reverted the versions.
bi...@google.com <bi...@google.com>
bi...@google.com <bi...@google.com> #8
I have the same problem and it reproduces the moment I add following lines to the settings.gradle.kts
and try to sync project:
includeBuild("../OtherLibrary") {
dependencySubstitution {
substitute(module("other:Library")).using(project(":library"))
}
}
It seams this crash happens only in "multi-root-project" (composite) projects. Crash doesn't reproduce with AGP 7.1, only with 7.2
Android Studio Chipmunk | 2021.2.1 Patch 1 Build #AI-212.5712.43.2112.8609683, built on May 18, 2022 Gradle Wrapper: gradle-7.3.3-bin.zip AGP: com.android.tools.build:gradle:7.2.1
bi...@google.com <bi...@google.com> #9
After further investigation by removing parts of my gradle files line-by-line I found that crash happens when CMake is present in the includeBuild
library.
externalNativeBuild {
cmake {
path = file("CMakeLists.txt") // comment this line and AnalyticsService crash disappears
}
}
I've created minimal sample application to reproduce this problem.
bi...@google.com <bi...@google.com> #10
Thanks for sharing the project! It would be really helpful for us to reproduce the issue. Just to confirm, the error appears with "Android Studio Chipmunk | 2021.2.1 Patch 1" right?
sg...@google.com <sg...@google.com> #11
Yes, It happens on 2021.2.1 Patch 1. Didn't try other versions.
ga...@google.com <ga...@google.com> #12
Nice work narrowing it down - I can also confirm I use CMake in an includeBuild library
bi...@google.com <bi...@google.com> #13
bi...@google.com <bi...@google.com> #14
[Deleted User] <[Deleted User]> #15
So far only workarouund I found is to use AGP 7.1 and AS Bamblebee. Otherwise it either crashes during sync or doesn't allow to debug C++ code :(
ey...@gmail.com <ey...@gmail.com> #16
One workaround is to disable analytics. You can go to ~/.android/analytics.settings
and change the hasOptedIn
value from true to false.
sg...@google.com <sg...@google.com> #17
Disabling analitics is fine for local machine but is really a chore when you have huge team and multiple build servers. Can it be done locally in the project so it can be pushed to git for example? Maybe in gradle.properties
or something similar?
ga...@google.com <ga...@google.com> #18
I am afraid it cannot be done in project like in gradle.properties
Description
For AGP 8.0 we should remove the injection of -ignorewarnings , and make missing classes an error.