What could be the cause of getting (latest anvil v...
# squarelibraries
d
What could be the cause of getting (latest anvil version for 1.6.10):
Copy code
com.squareup.anvil.compiler.api.AnvilCompilationException: Back-end (JVM) Internal error: Couldn't resolve class for anvil.module.AppComponentAnvilModule.
File being compiled: (11,1) in /anvil/module/AppComponentAnvilModule.kt
r
I can't tell from that message. There should be a longer stacktrace. Please file a bug.
d
Could it be that since part of my classes are in the root package, Anvil and dagger can't handle them?
Here's the stacktrace:
Copy code
com.squareup.anvil.compiler.api.AnvilCompilationException: Back-end (JVM) Internal error: Couldn't resolve class for anvil.module.AppComponentAnvilModule.
File being compiled: (11,1) in /anvil/module/AppComponentAnvilModule.kt

	at com.squareup.anvil.compiler.internal.PsiUtilsKt.requireClassDescriptor(PsiUtils.kt:808)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt$findFqNameInSuperTypes$1.invoke(PsiUtils.kt:524)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt$findFqNameInSuperTypes$1.invoke(PsiUtils.kt:519)
	at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:315)
	at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303)
	at kotlin.sequences.SequencesKt___SequencesKt.firstOrNull(_Sequences.kt:167)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt.findFqNameInSuperTypes(PsiUtils.kt:528)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt.requireFqName(PsiUtils.kt:481)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt.requireFqName(PsiUtils.kt:376)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt.scopeOrNull(PsiUtils.kt:177)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt.scopeOrNull(PsiUtils.kt:170)
	at com.squareup.anvil.compiler.internal.PsiUtilsKt.scope(PsiUtils.kt:157)
	at com.squareup.anvil.compiler.codegen.ContributesToGenerator$generateCode$3.invoke(ContributesToGenerator.kt:84)
	at com.squareup.anvil.compiler.codegen.ContributesToGenerator$generateCode$3.invoke(ContributesToGenerator.kt:77)
	at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
	at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786)
	at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:816)
	at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:807)
	at com.squareup.anvil.compiler.codegen.ContributesToGenerator.generateCode(ContributesToGenerator.kt:118)
	at com.squareup.anvil.compiler.codegen.CodeGenerationExtension.analysisCompleted$generateCode(CodeGenerationExtension.kt:96)
	at com.squareup.anvil.compiler.codegen.CodeGenerationExtension.analysisCompleted(CodeGenerationExtension.kt:136)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:112)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:122)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:96)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:262)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:53)
	at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:113)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:253)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:100)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:58)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:170)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
	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:1618)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
I'll try to file a bug later, if needed.
r
That could be the reason. Please include a short sample when filing the bug.