Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint crash when updating to Kotlin 1.8.20 #106

Closed
ZacSweers opened this issue Apr 18, 2023 · 0 comments · Fixed by #107
Closed

Lint crash when updating to Kotlin 1.8.20 #106

ZacSweers opened this issue Apr 18, 2023 · 0 comments · Fixed by #107

Comments

@ZacSweers
Copy link
Collaborator

<issue
  category="Lint"
  errorLine1=""
  errorLine2=""
  explanation="This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc. These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed."
  id="LintError"
  message="Unexpected failure during lint analysis of TypeAdapterIntegrationTest.java (this is a bug in lint or one of the libraries it depends on) Message: java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandle.linkToStatic(Object,Object,Object,Object,Object,int,MemberName)Object/invokeStatic The crash seems to involve the detector `slack.lint.compose.M2ApiDetector`. You can try disabling it with something like this:     android {         lint {             disable "ComposeM2Api"         }     } Stack: `InternalError:MethodHandleStatics.newInternalError(MethodHandleStatics.java:157)←DirectMethodHandle.makePreparedLambdaForm(DirectMethodHandle.java:264)←DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:231)←DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:216)←DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:225)←DirectMethodHandle.make(DirectMethodHandle.java:106)←MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:4019)←MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:3975)←MethodHandles$Lookup.getDirectMethodForConstant(MethodHandles.java:4219)←MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:4167)←MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:612)←InferenceSession.isMoreSpecific(InferenceSession.java:1662)←JavaMethodsConflictResolver.isApplicableTo(JavaMethodsConflictResolver.java:635)←JavaMethodsConflictResolver.isMoreSpecific(JavaMethodsConflictResolver.java:523)←JavaMethodsConflictResolver.checkSpecifics(JavaMethodsConflictResolver.java:142)←JavaMethodsConflictResolver.guardedOverloadResolution(JavaMethodsConflictResolver.java:90)←JavaMethodsConflictResolver.resolveConflict(JavaMethodsConflictResolver.java:54)←ConflictFilterProcessor.getResult(ConflictFilterProcessor.java:76)←PsiReferenceExpressionImpl.resolveToMethod(PsiReferenceExpressionImpl.java:301)←PsiReferenceExpressionImpl.resolve(PsiReferenceExpressionImpl.java:275)←PsiReferenceExpressionImpl.access$000(PsiReferenceExpressionImpl.java:44)←PsiReferenceExpressionImpl$OurGenericsResolver.resolve(PsiReferenceExpressionImpl.java:182)←PsiReferenceExpressionImpl$OurGenericsResolver.resolve(PsiReferenceExpressionImpl.java:172)←ResolveCache.lambda$resolveWithCaching$2(ResolveCache.java:176)←Computable.get(Computable.java:16)←ResolveCache.lambda$loggingResolver$4(ResolveCache.java:237)←RecursionManager$1.computePreventingRecursion(RecursionManager.java:112)←RecursionGuard.doPreventingRecursion(RecursionGuard.java:42)←RecursionManager.doPreventingRecursion(RecursionManager.java:66)←ResolveCache.resolve(ResolveCache.java:214)←ResolveCache.resolveWithCaching(ResolveCache.java:176)←PsiImplUtil.multiResolveImpl(PsiImplUtil.java:801)←PsiImplUtil.multiResolveImpl(PsiImplUtil.java:793)←PsiImplUtil.multiResolveImpl(PsiImplUtil.java:769)←PsiReferenceExpressionImpl.multiResolve(PsiReferenceExpressionImpl.java:338)←PsiReferenceExpressionImpl.advancedResolve(PsiReferenceExpressionImpl.java:491)←PsiReferenceExpressionImpl.resolve(PsiReferenceExpressionImpl.java:798)←PsiMethodCallExpressionImpl.resolveMethod(PsiMethodCallExpressionImpl.java:45)←JavaUCallExpression.resolve(javaUCallExpressions.kt:83)←JavaUCallExpression.resolve(javaUCallExpressions.kt:27)←JavaUCompositeQualifiedExpression.resolve(JavaUCompositeQualifiedExpression.kt:40)←M2ApiDetector$createUastHandler$1.checkNode(M2ApiDetector.kt:71)←M2ApiDetector$createUastHandler$1.visitQualifiedReferenceExpression(M2ApiDetector.kt:68)←UElementVisitor$DispatchPsiVisitor.visitQualifiedReferenceExpression(UElementVisitor.kt:821)←UQualifiedReferenceExpression.accept(UQualifiedReferenceExpression.kt:31)←UVariableKt.visitContents(UVariable.kt:68)←UVariableKt.access$visitContents(UVariable.kt:1)←ULocalVariable.accept(UVariable.kt:123)←ImplementationUtilsKt.acceptList(implementationUtils.kt:14)←UDeclarationsExpression.accept(UDeclarationsExpression.kt:22)←ImplementationUtilsKt.acceptList(implementationUtils.kt:14)←UBlockExpression.accept(UBlockExpression.kt:21)←UMethod.accept(UMethod.kt:45)←ImplementationUtilsKt.acceptList(implementationUtils.kt:14)←UClass.accept(UClass.kt:64)←ImplementationUtilsKt.acceptList(implementationUtils.kt:14)←UFile.accept(UFile.kt:89)←UastLintUtilsKt.acceptSourceFile(UastLintUtils.kt:735)←UElementVisitor$visitFile$3.run(UElementVisitor.kt:267)←LintClient.runReadAction(LintClient.kt:1700)←LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2867)←UElementVisitor.visitFile(UElementVisitor.kt:264)←LintDriver$visitUastDetectors$1.run(LintDriver.kt:2165)←LintClient.runReadAction(LintClient.kt:1700)←LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2867)←LintDriver.visitUastDetectors(LintDriver.kt:2165)←LintDriver.visitUast(LintDriver.kt:2150)←LintDriver.runFileDetectors(LintDriver.kt:1379)←LintDriver.checkProject(LintDriver.kt:1144)←LintDriver.checkProjectRoot(LintDriver.kt:615)←LintDriver.access$checkProjectRoot(LintDriver.kt:170)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:441)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:438)←LintDriver.doAnalyze(LintDriver.kt:497)←LintDriver.analyzeOnly(LintDriver.kt:438)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:237)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:237)←LintCliClient.run(LintCliClient.kt:279)←LintCliClient.run$default(LintCliClient.kt:262)←LintCliClient.analyzeOnly(LintCliClient.kt:237)←Main.run(Main.java:1687)←Main.run(Main.java:275)←DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)←Method.invoke(Method.java:578)←AndroidLintWorkAction.invokeLintMainRunMethod(AndroidLintWorkAction.kt:96)←AndroidLintWorkAction.runLint(AndroidLintWorkAction.kt:85)←AndroidLintWorkAction.execute(AndroidLintWorkAction.kt:61)←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:204)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)` You can run with --stacktrace or set environment variable `LINT_PRINT_STACKTRACE=true` to dump a full stacktrace to stdout." 
  priority="10"
  severity="Error"
  summary="Lint Failure">
  <location file="src/test/java/slack/api/utils/TypeAdapterIntegrationTest.java"/>
</issue>

Formatted trace below. This looks like a bug in lint :(

Unexpected failure during lint analysis of TypeAdapterIntegrationTest.java (this is a bug in lint or one of the libraries it depends on)
Message: java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandle.linkToStatic(Object,Object,Object,Object,Object,int,MemberName)Object/invokeStatic
The crash seems to involve the detector `slack.lint.compose.M2ApiDetector`
You can try disabling it with something like this:     android {         lint {             disable "ComposeM2Api"         }     }
Stack:
Caused by: InternalError
  at MethodHandleStatics.newInternalError(MethodHandleStatics.java:157)
  at DirectMethodHandle.makePreparedLambdaForm(DirectMethodHandle.java:264)
  at DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:231)
  at DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:216)
  at DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:225)
  at DirectMethodHandle.make(DirectMethodHandle.java:106)
  at MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:4019)
  at MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:3975)
  at MethodHandles$Lookup.getDirectMethodForConstant(MethodHandles.java:4219)
  at MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:4167)
  at MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:612)
  at InferenceSession.isMoreSpecific(InferenceSession.java:1662)
  at JavaMethodsConflictResolver.isApplicableTo(JavaMethodsConflictResolver.java:635)
  at JavaMethodsConflictResolver.isMoreSpecific(JavaMethodsConflictResolver.java:523)
  at JavaMethodsConflictResolver.checkSpecifics(JavaMethodsConflictResolver.java:142)
  at JavaMethodsConflictResolver.guardedOverloadResolution(JavaMethodsConflictResolver.java:90)
  at JavaMethodsConflictResolver.resolveConflict(JavaMethodsConflictResolver.java:54)
  at ConflictFilterProcessor.getResult(ConflictFilterProcessor.java:76)
  at PsiReferenceExpressionImpl.resolveToMethod(PsiReferenceExpressionImpl.java:301)
  at PsiReferenceExpressionImpl.resolve(PsiReferenceExpressionImpl.java:275)
  at PsiReferenceExpressionImpl.access$000(PsiReferenceExpressionImpl.java:44)
  at PsiReferenceExpressionImpl$OurGenericsResolver.resolve(PsiReferenceExpressionImpl.java:182)
  at PsiReferenceExpressionImpl$OurGenericsResolver.resolve(PsiReferenceExpressionImpl.java:172)
  at ResolveCache.lambda$resolveWithCaching$2(ResolveCache.java:176)
  at Computable.get(Computable.java:16)
  at ResolveCache.lambda$loggingResolver$4(ResolveCache.java:237)
  at RecursionManager$1.computePreventingRecursion(RecursionManager.java:112)
  at RecursionGuard.doPreventingRecursion(RecursionGuard.java:42)
  at RecursionManager.doPreventingRecursion(RecursionManager.java:66)
  at ResolveCache.resolve(ResolveCache.java:214)
  at ResolveCache.resolveWithCaching(ResolveCache.java:176)
  at PsiImplUtil.multiResolveImpl(PsiImplUtil.java:801)
  at PsiImplUtil.multiResolveImpl(PsiImplUtil.java:793)
  at PsiImplUtil.multiResolveImpl(PsiImplUtil.java:769)
  at PsiReferenceExpressionImpl.multiResolve(PsiReferenceExpressionImpl.java:338)
  at PsiReferenceExpressionImpl.advancedResolve(PsiReferenceExpressionImpl.java:491)
  at PsiReferenceExpressionImpl.resolve(PsiReferenceExpressionImpl.java:798)
  at PsiMethodCallExpressionImpl.resolveMethod(PsiMethodCallExpressionImpl.java:45)
  at JavaUCallExpression.resolve(javaUCallExpressions.kt:83)
  at JavaUCallExpression.resolve(javaUCallExpressions.kt:27)
  at JavaUCompositeQualifiedExpression.resolve(JavaUCompositeQualifiedExpression.kt:40)
  at M2ApiDetector$createUastHandler$1.checkNode(M2ApiDetector.kt:71)
  at M2ApiDetector$createUastHandler$1.visitQualifiedReferenceExpression(M2ApiDetector.kt:68)
  at UElementVisitor$DispatchPsiVisitor.visitQualifiedReferenceExpression(UElementVisitor.kt:821)
  at UQualifiedReferenceExpression.accept(UQualifiedReferenceExpression.kt:31)
  at UVariableKt.visitContents(UVariable.kt:68)
  at UVariableKt.access$visitContents(UVariable.kt:1)
  at ULocalVariable.accept(UVariable.kt:123)
  at ImplementationUtilsKt.acceptList(implementationUtils.kt:14)
  at UDeclarationsExpression.accept(UDeclarationsExpression.kt:22)
  at ImplementationUtilsKt.acceptList(implementationUtils.kt:14)
  at UBlockExpression.accept(UBlockExpression.kt:21)
  at UMethod.accept(UMethod.kt:45)
  at ImplementationUtilsKt.acceptList(implementationUtils.kt:14)
  at UClass.accept(UClass.kt:64)
  at ImplementationUtilsKt.acceptList(implementationUtils.kt:14)
  at UFile.accept(UFile.kt:89)
  at UastLintUtilsKt.acceptSourceFile(UastLintUtils.kt:735)
  at UElementVisitor$visitFile$3.run(UElementVisitor.kt:267)
  at LintClient.runReadAction(LintClient.kt:1700)
  at LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2867)
  at UElementVisitor.visitFile(UElementVisitor.kt:264)
  at LintDriver$visitUastDetectors$1.run(LintDriver.kt:2165)
  at LintClient.runReadAction(LintClient.kt:1700)
  at LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2867)
  at LintDriver.visitUastDetectors(LintDriver.kt:2165)
  at LintDriver.visitUast(LintDriver.kt:2150)
  at LintDriver.runFileDetectors(LintDriver.kt:1379)
  at LintDriver.checkProject(LintDriver.kt:1144)
  at LintDriver.checkProjectRoot(LintDriver.kt:615)
  at LintDriver.access$checkProjectRoot(LintDriver.kt:170)
  at LintDriver$analyzeOnly$1.invoke(LintDriver.kt:441)
  at LintDriver$analyzeOnly$1.invoke(LintDriver.kt:438)
  at LintDriver.doAnalyze(LintDriver.kt:497)
  at LintDriver.analyzeOnly(LintDriver.kt:438)
  at LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:237)
  at LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:237)
  at LintCliClient.run(LintCliClient.kt:279)
  at LintCliClient.run$default(LintCliClient.kt:262)
  at LintCliClient.analyzeOnly(LintCliClient.kt:237)
  at Main.run(Main.java:1687)
  at Main.run(Main.java:275)
  at DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
  at Method.invoke(Method.java:578)
  at AndroidLintWorkAction.invokeLintMainRunMethod(AndroidLintWorkAction.kt:96)
  at AndroidLintWorkAction.runLint(AndroidLintWorkAction.kt:85)
  at AndroidLintWorkAction.execute(AndroidLintWorkAction.kt:61)
  at DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
  at NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
  at NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
  at ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
  at NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
  at AbstractWorker$1.call(AbstractWorker.java:44)
  at AbstractWorker$1.call(AbstractWorker.java:41)
  at DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
  at DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
  at DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
  at DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
  at DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
  at DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)` You can run with --stacktrace or set environment variable `LINT_PRINT_STACKTRACE=true` to dump a full stacktrace to stdout.

Failing file looks innocuous, but I think what matters here is that the M2 lint check shouldn't be checking Java files at all.

ZacSweers added a commit that referenced this issue Apr 18, 2023
This isn't applicable to Java anyway, effectively resolves #106 along the way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant