https://kotlinlang.org logo
a

aiidziis

03/06/2021, 9:21 AM
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

Zach Klippenstein (he/him) [MOD]

03/06/2021, 5:40 PM
Which versions of everything are you using? (Kotlin, Anvil, Compose)
a

aiidziis

03/06/2021, 5:43 PM
Kotlin 1.4.30, Anvil 2.1.0, Compose beta01.
b

Bruno Kongawi

03/06/2021, 10:18 PM
Was experiencing something similar to this, but I think it was fixed in Anvil. Which version of Gradle are you using?
a

aiidziis

03/07/2021, 7:19 AM
Gradle wrapper version 6.8.3, Gradle tools 4.0.2
b

Bruno Kongawi

03/12/2021, 12:08 AM
try updating your gradle tools?
z

Zach Klippenstein (he/him) [MOD]

03/12/2021, 12:10 AM
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

ralf

03/12/2021, 1:06 AM
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

aiidziis

03/12/2021, 5:36 AM
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

miqbaldc

03/25/2021, 9:42 AM
does it requires additional tweaks on the
anvil
setup that you able to share with us to workaround the issue?
47 Views