Status Update
Comments
ba...@google.com <ba...@google.com>
er...@google.com <er...@google.com>
fl...@instant-system.com <fl...@instant-system.com> #2
```
89: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':core:network:lintAnalyzeProdDefaultThemeDebug'.
> A failure occurred while executing com.android.build.gradle.internal.lint.AndroidLintWorkAction
> Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
Message: Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
Message: Unexpected failure during lint analysis of JourneyRequest.kt (this is a bug in lint or one of the libraries it depends on)
Message: class org.jetbrains.kotlin.analysis.api.fir.symbols.pointers.KaFirMemberFunctionSymbolPointer pointer already disposed
The crash seems to involve the detector \\\`androidx.annotation.experimental.lint.ExperimentalDetector\\\`.
You can try disabling it with something like this:
????android {
????????lint {
????????????disable "UnsafeOptInUsageError", "UnsafeOptInUsageWarning"
????????}
????}
Stack: \\\`KotlinIllegalArgumentExceptionWithAttachments:SymbolLightUtilsKt.restoreSymbolOrThrowIfDisposed(symbolLightUtils.kt:433)?SymbolLightSimpleMethod.hasInlineOnlyAnnotation_delegate$lambda$18(SymbolLightSimpleMethod.kt:651)?SafePublicationLazyImpl.getValue(LazyJVM.kt:107)?SymbolLightSimpleMethod.getHasInlineOnlyAnnotation(SymbolLightSimpleMethod.kt:145)?SymbolLightSimpleMethod.computeModifiers(SymbolLightSimpleMethod.kt:312)?SymbolLightSimpleMethod.access$computeModifiers(SymbolLightSimpleMethod.kt:34)?SymbolLightSimpleMethod$_modifierList$2$1.invoke(SymbolLightSimpleMethod.kt:150)?SymbolLightSimpleMethod$_modifierList$2$1.invoke(SymbolLightSimpleMethod.kt:150)?GranularModifiersBox.hasModifier(GranularModifiersBox.kt:36)?SymbolLightModifierList.hasModifierProperty(SymbolLightModifierList.kt:47)?SymbolLightMemberModifierList.hasModifierProperty(SymbolLightMemberModifierList.kt:28)?JavaEvaluator.isStatic(JavaEvaluator.kt:253)?JavaEvaluator.isOverride(JavaEvaluator.kt:1226)?ExperimentalDetector.visitClass(ExperimentalDetector.kt:115)?UElementVisitor$SuperclassUastVisitor.visitClass(UElementVisitor.kt:363)?AbstractKotlinUClass.accept(AbstractKotlinUClass.kt:210)?ImplementationUtilsKt.acceptList(implementationUtils.kt:15)?UFile.accept(UFile.kt:89)?UastLintUtilsKt.acceptSourceFile(UastLintUtils.kt:953)?UElementVisitor.visitFile$lambda$4(UElementVisitor.kt:202)?LintClient.runReadAction(LintClient.kt:1781)?LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2747)?UElementVisitor.visitFile(UElementVisitor.kt:200)?LintDriver.visitUastDetectors$lambda$42(LintDriver.kt:2048)?LintClient.runReadAction(LintClient.kt:1781)?LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2747)?LintDriver.visitUastDetectors(LintDriver.kt:2048)?LintDriver.visitUast(LintDriver.kt:2010)?LintDriver.runFileDetectors(LintDriver.kt:1284)?LintDriver.checkProject(LintDriver.kt:1070)?LintDriver.checkProjectRoot(LintDriver.kt:622)?LintDriver.access$checkProjectRoot(LintDriver.kt:174)?LintDriver$analyzeOnly$1.invoke(LintDriver.kt:445)?LintDriver$analyzeOnly$1.invoke(LintDriver.kt:442)?LintDriver.doAnalyze(LintDriver.kt:501)?LintDriver.analyzeOnly(LintDriver.kt:442)?LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:259)?LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:256)?LintCliClient.run(LintCliClient.kt:313)?LintCliClient.analyzeOnly(LintCliClient.kt:256)?Main.run(Main.java:1766)?Main.run(Main.java:282)?GeneratedMethodAccessor1353.invoke(null:-1)?DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)?Method.invoke(Method.java:568)?AndroidLintWorkAction.invokeLintMainRunMethod(AndroidLintWorkAction.kt:103)?AndroidLintWorkAction.runLint(AndroidLintWorkAction.kt:90)?AndroidLintWorkAction.execute(AndroidLintWorkAction.kt:64)?DefaultWorkerServer.execute(DefaultWorkerServer.java:63)?NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)?NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)?ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)?NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)?AbstractWorker$1.call(AbstractWorker.java:44)?AbstractWorker$1.call(AbstractWorker.java:41)?DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:210)?DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:205)?DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:67)?DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:60)?DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:167)?DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:60)?DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:54)?AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)?NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)?DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:174)?FutureTask.run(FutureTask.java:264)?DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:194)?DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:127)?DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:169)?Factories$1.create(Factories.java:31)?DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:263)?DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:127)?DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:132)?DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)?DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:133)?Executors$RunnableAdapter.call(Executors.java:539)?FutureTask.run(FutureTask.java:264)?ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)?AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)?ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)?ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)?Thread.run(Thread.java:840)\\\`
```
The following piece of code triggers the crash:
```
@Serializable
public data class Request(
@SerialName("requests") val requests: HashMap<String, @Serializable(RequestDetailsSerializer::class) RequestDetails>
)
```
Namely, the @Serializable(RequestDetailsSerializer::class) inside the type definition is what the lint fails on.
js...@google.com <js...@google.com>
js...@google.com <js...@google.com> #3
I'd create a different issue, but I apparently lack the rights to create them in the Lint component
Yeah, you can create an issue on sort of top-level component, and then it's us to triage them to a seemingly right component. Thank you for chiming in; it looks the errors / root causes are the same.
js...@google.com <js...@google.com> #4
I once hit the following stacktrace in the local run of Studio (i.e., Lint IDE):
2025-02-27 23:05:54,683 [2647805] SEVERE - #com.android.tools.idea.lint.common.LintIdeClient - class org.jetbrains.kotlin.analysis.api.fir.symbols.pointers.KaFirMemberFunctionSymbolPointer pointer already disposed
org.jetbrains.kotlin.utils.exceptions.KotlinIllegalArgumentExceptionWithAttachments: class org.jetbrains.kotlin.analysis.api.fir.symbols.pointers.KaFirMemberFunctionSymbolPointer pointer already disposed
at org.jetbrains.kotlin.light.classes.symbol.SymbolLightUtilsKt.restoreSymbolOrThrowIfDisposed(symbolLightUtils.kt:433)
at org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightSimpleMethod.hasInlineOnlyAnnotation_delegate$lambda$18(SymbolLightSimpleMethod.kt:651)
at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107)
at org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightSimpleMethod.getHasInlineOnlyAnnotation(SymbolLightSimpleMethod.kt:145)
at org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightSimpleMethod.computeModifiers(SymbolLightSimpleMethod.kt:312)
at org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightSimpleMethod.access$computeModifiers(SymbolLightSimpleMethod.kt:34)
at org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightSimpleMethod$_modifierList$2$1.invoke(SymbolLightSimpleMethod.kt:150)
at org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightSimpleMethod$_modifierList$2$1.invoke(SymbolLightSimpleMethod.kt:150)
at org.jetbrains.kotlin.light.classes.symbol.modifierLists.GranularModifiersBox.hasModifier(GranularModifiersBox.kt:36)
at org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightModifierList.hasModifierProperty(SymbolLightModifierList.kt:47)
at org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightMemberModifierList.hasModifierProperty(SymbolLightMemberModifierList.kt:28)
at com.android.tools.lint.client.api.JavaEvaluator.isStatic(JavaEvaluator.kt:253)
at com.android.tools.lint.client.api.JavaEvaluator.isOverride(JavaEvaluator.kt:1226)
at androidx.annotation.experimental.lint.ExperimentalDetector.visitClass(ExperimentalDetector.kt:115)
at com.android.tools.lint.client.api.UElementVisitor$SuperclassUastVisitor.visitClass(UElementVisitor.kt:365)
at org.jetbrains.uast.kotlin.AbstractKotlinUClass.accept(AbstractKotlinUClass.kt:210)
at org.jetbrains.uast.internal.ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
at org.jetbrains.uast.UFile.accept(UFile.kt:89)
at com.android.tools.lint.detector.api.UastLintUtilsKt.acceptSourceFile(UastLintUtils.kt:1013)
at com.android.tools.lint.client.api.UElementVisitor.visitFile$lambda$4(UElementVisitor.kt:202)
at com.android.tools.idea.lint.common.LintIdeClient.lambda$runReadAction$0(LintIdeClient.java:245)
at com.intellij.openapi.application.rw.PlatformReadWriteActionSupport.computeCancellable$lambda$1(PlatformReadWriteActionSupport.kt:43)
at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$3$lambda$2$lambda$1(cancellableReadAction.kt:32)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:333)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:972)
at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$3$lambda$2(cancellableReadAction.kt:30)
at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:157)
at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:28)
at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadAction$lambda$0(cancellableReadAction.kt:17)
at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:81)
at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadAction(cancellableReadAction.kt:16)
at com.intellij.openapi.application.rw.PlatformReadWriteActionSupport.computeCancellable(PlatformReadWriteActionSupport.kt:42)
at com.intellij.openapi.application.ReadAction.computeCancellable(ReadAction.java:115)
at com.android.tools.idea.lint.common.LintIdeClient.runReadAction(LintIdeClient.java:244)
at com.android.tools.lint.client.api.LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2758)
at com.android.tools.lint.client.api.UElementVisitor.visitFile(UElementVisitor.kt:200)
at com.android.tools.lint.client.api.LintDriver.visitUastDetectors$lambda$48(LintDriver.kt:2054)
at com.android.tools.idea.lint.common.LintIdeClient.lambda$runReadAction$0(LintIdeClient.java:245)
with the following sample code:
package com.example.serializabletest
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.descriptors.buildClassSerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import androidx.annotation.RequiresOptIn
@Serializable
data class Request(
val requests: Set<@Serializable(RequestDetailsSerializer::class) DateProviderKt>
)
object RequestDetailsSerializer : KSerializer<DateProviderKt> {
override val descriptor: SerialDescriptor = buildClassSerialDescriptor("RequestDetails")
override fun deserialize(decoder: Decoder): DateProviderKt {
TODO("Not yet implemented")
}
override fun serialize(encoder: Encoder, value: DateProviderKt) {
TODO("Not yet implemented")
}
}
@RequiresOptIn
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class ExperimentalDateTimeKt
@ExperimentalDateTimeKt
open class DateProviderKt {
fun getDate(): Int {
return -1
}
}
but not really reproducible from the command line run (like ./gradlew :app:lint
). Also, too late to catch what it is in the debug run, while trying several other combinations... :'(
AFAIK, androidx.annotation.experimental.lint.ExperimentalDetector
is from androidx.annotation
. Can someone clarify which version they're using? If not sure, you can run ./gradlew :...:dependencies
to draw the dependency graph because it may be transitive dependency. To that end, I'm also curious about what compose BOM is used, too, as it may be bundled from it.
js...@google.com <js...@google.com> #5
The code pattern, though, reminded me of some similar issues, e.g., data
class, broken from 2.1.0 to 2.1.20, perhaps similar to annotation on type of member of data
class, as it will be eventually used/propagated to synthetic members.
First known bad(?) build would be AGP 8.8.0-alpha04
when kotlinc artifact 2.1.0-Beta1
was landed, but if the problem existed before, perhaps AGP 8.7.x
and 8.8.x
are within this window. (TBH, I'm afraid 8.9.x
too..., since the fix would be 2.1.20-Beta2
, which is AGP 8.10.0-alpha05
...)
fl...@instant-system.com <fl...@instant-system.com> #6
As a workaround, it seems like a typealias makes lint happy, and my tests keep working, so the serializer information is kept with the typealias.
private typealias OptionsMap = HashMap<String, @Serializable(QueryParameterSerializer::class) QueryParameter>
data class Request(
@SerialName("options") val options: OptionsMap,
)
No longer causes any failures
js...@google.com <js...@google.com> #7
^ Thank you for sharing the workaround!
But, would you mind sharing other versions of libraries you're using (besides AGP)? In particular, I'm curious about Compose BOM (if used), Compose annotations (if directly used), and some others if possible.
fl...@instant-system.com <fl...@instant-system.com> #8
Yep. I detected it during a bump of some of our dependencies, so it's possible that continuing to bump them would fix the issue. I'll update once it's fully done and if I can keep reproducing it.
androidx-compose-bom = "2024.09.01"
kotlin = "2.0.20"
android-gradle-plugin = "8.8.1"
google-ksp = "2.0.20-1.0.24"
no compose annotations directly used, androidx-annotation = "1.8.2"
Description
DESCRIBE THE ISSUE IN DETAIL:
After updating the grade plugin to version 8.7.3 (from 8.6.x) the linter fails to run successfuly. This issue was not present in previous version of plugin.
STEPS TO REPRODUCE:
Stacktrace:
Studio Build: Android Studio Ladybug | 2024.2.1 Patch 3 Build #AI-242.23339.11.2421.12700392, built on November 22, 2024 Runtime version: 21.0.3+-79915917-b509.11 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Version of Gradle Plugin: 8.7.3 Version of Gradle: 8.12 OS: OSX