Status Update
Comments
em...@google.com <em...@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?
em...@google.com <em...@google.com>
ap...@google.com <ap...@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.
ap...@google.com <ap...@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.
Description
Sealed classes and interfaces cannot be extended directly outside their module. Intuitively this implies they are effectively final, and therefore otherwise incompatible changes would be allowed, such as adding a new abstract method.
Unfortunately, it's possible to extend a sealed class with an abstract class as below and inadvertently expose a new abstract method (
funFromSealed()
in the example below). We should figure out how we want to model this behavior in Metalava, figure out if there's any other considerations to sealed classes, and then maybe updateClassItem.isEffectivelyFinal()
to match.