Hey! Has anyone tried enabling Anvil and Jetpack C...
# squarelibraries
a
Hey! Has anyone tried enabling Anvil and Jetpack Compose in the same module? Currently we are having issues with it. Stacktrace in thread.
Copy code
exception: java.lang.NoSuchMethodError: org.jetbrains.kotlin.com.intellij.mock.MockProject.getExtensionArea()Lorg/jetbrains/kotlin/com/intellij/openapi/extensions/impl/ExtensionsAreaImpl;
	at com.squareup.anvil.compiler.AnvilComponentRegistrar.registerExtensionFirst(AnvilComponentRegistrar.kt:96)
	at com.squareup.anvil.compiler.AnvilComponentRegistrar.registerProjectComponents(AnvilComponentRegistrar.kt:67)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:602)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:137)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:177)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:117)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:424)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:228)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:154)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:56)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:85)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:82)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:50)
	at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:215)
	at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:207)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:270)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
z
Which versions of everything are you using? (Kotlin, Anvil, Compose)
a
Kotlin 1.4.30, Anvil 2.1.0, Compose beta01.
b
Was experiencing something similar to this, but I think it was fixed in Anvil. Which version of Gradle are you using?
a
Gradle wrapper version 6.8.3, Gradle tools 4.0.2
b
try updating your gradle tools?
z
I have had Anvil and Compose both applied to the same module, and that worked fine, but the module wasn’t really using Anvil for anything. I don’t have any better answers unfortunately. @ralf might but i don’t think he’s gonna be around for a while.
r
That’s the issue that was fixed: https://github.com/square/anvil/issues/190 It seems like you run into something slightly different. Would you mind filing a ticket with a sample project to reproduce the bug for me?
👍 2
a
Yeah, will create a sample project on weekend. Hopefully will be able to reproduce it in isolated project.
Tried to reproduce in isolated project and couldn’t reproduce. Thankfully managed to get it working on our project. 🙌🏻
m
does it requires additional tweaks on the
anvil
setup that you able to share with us to workaround the issue?