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

NoSuchMethodError when compiling with Kotlin 1.4.20 #159

Closed
colinrtwhite opened this issue Nov 19, 2020 · 3 comments
Closed

NoSuchMethodError when compiling with Kotlin 1.4.20 #159

colinrtwhite opened this issue Nov 19, 2020 · 3 comments
Assignees
Labels
Kotlin 1.4 Requires Kotlin 1.4

Comments

@colinrtwhite
Copy link
Member

Hi, we're running into the following stack trace when compiling with Kotlin 1.4.20 and Anvil 2.0.8.

It looks like Anvil 2.0.8 was compiled with Kotlin 1.4.20-RC here, however we're still seeing the error.

Related: #117

e: java.lang.IllegalStateException: Backend Internal error: Exception during file facade code generation
The root cause java.lang.NoSuchMethodError was thrown at: com.squareup.anvil.compiler.ModuleMerger$generateClassSyntheticParts$modules$4.invoke(ModuleMerger.kt:100)
        at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239)
        at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generate(PackageCodegenImpl.java:78)
        at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generatePackage(CodegenFactory.kt:88)
        at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generateModule(CodegenFactory.kt:67)
        at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.contextForStubGeneration(Kapt3Extension.kt:276)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:169)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:100)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:108)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:118)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:93)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:557)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:83)
        at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:548)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.repeatAnalysisIfNeeded(KotlinToJVMBytecodeCompiler.kt:518)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:192)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:162)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1560)
        at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
        at sun.rmi.transport.Transport$1.run(Transport.java:200)
        at sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: org.jetbrains.kotlin.descriptors.EffectiveVisibilityKt.effectiveVisibility$default(Lorg/jetbrains/kotlin/descriptors/ClassDescriptor;ZILjava/lang/Object;)Lorg/jetbrains/kotlin/descriptors/EffectiveVisibility;
        at com.squareup.anvil.compiler.ModuleMerger$generateClassSyntheticParts$modules$4.invoke(ModuleMerger.kt:100)
        at com.squareup.anvil.compiler.ModuleMerger$generateClassSyntheticParts$modules$4.invoke(ModuleMerger.kt:35)
        at kotlin.sequences.SequencesKt___SequencesKt$onEach$1.invoke(_Sequences.kt:1944)
        at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
        at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:314)
        at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303)
        at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:752)
        at kotlin.sequences.SequencesKt___SequencesKt.toHashSet(_Sequences.kt:764)
        at kotlin.sequences.SequencesKt___SequencesKt$minus$4.iterator(_Sequences.kt:2471)
        at kotlin.sequences.SequencesKt___SequencesKt$minus$4.iterator(_Sequences.kt:2473)
        at kotlin.sequences.SequencesKt___SequencesKt$minus$3.iterator(_Sequences.kt:2450)
        at kotlin.sequences.DistinctSequence.iterator(Sequences.kt:563)
        at com.squareup.anvil.compiler.ModuleMerger.generateClassSyntheticParts(ModuleMerger.kt:346)
        at org.jetbrains.kotlin.codegen.ImplementationBodyCodegen.generateSyntheticPartsAfterBody(ImplementationBodyCodegen.java:440)
        at org.jetbrains.kotlin.codegen.MemberCodegen.generate(MemberCodegen.java:132)
        at org.jetbrains.kotlin.codegen.MemberCodegen.genClassOrObject(MemberCodegen.java:302)
        at org.jetbrains.kotlin.codegen.MemberCodegen.genClassOrObject(MemberCodegen.java:286)
        at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generateClassesAndObjectsInFile(PackageCodegenImpl.java:119)
        at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generateFile(PackageCodegenImpl.java:138)
        at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generate(PackageCodegenImpl.java:70)
        ... 38 more
@vRallev vRallev self-assigned this Nov 19, 2020
@vRallev vRallev added the Kotlin 1.4 Requires Kotlin 1.4 label Nov 19, 2020
@vRallev
Copy link
Collaborator

vRallev commented Nov 19, 2020

Yes, the currently built version doesn't work with Kotlin 1.4.20. There was a breaking ABI change within the compiler. The plan is to release a new version next Monday with a fix.

@colinrtwhite
Copy link
Member Author

@vRallev Sounds good, thanks for the quick response!

@chrisjenx
Copy link

Thanks @vRallev !

vRallev added a commit that referenced this issue Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kotlin 1.4 Requires Kotlin 1.4
Projects
None yet
Development

No branches or pull requests

3 participants