Hi! I'm getting a funny error when adding the Anvi...
# squarelibraries
d
Hi! I'm getting a funny error when adding the Anvil plugin (this is a Ktor server-side service). I pasted it in the thread...
Cause 1: java.lang.NoClassDefFoundError: com/android/build/gradle/internal/tasks/factory/TaskFactoryUtils at com.squareup.anvil.plugin.AnvilPlugin.disableIncrementalCompilationWhenTheCompilerClasspathChanges(AnvilPlugin.kt:259) at com.squareup.anvil.plugin.AnvilPlugin.disableIncrementalKotlinCompilation(AnvilPlugin.kt:198) at com.squareup.anvil.plugin.AnvilPlugin.applyToCompilation(AnvilPlugin.kt:107) at org.jetbrains.kotlin.gradle.plugin.SubpluginEnvironment.addSubpluginOptions(Subplug
Before that: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':api'. Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
Does Anvil automatically include the dagger deps, or maybe that's what's missing? (It doesn't seem to mention anything in the docs...)
Or maybe it's only for Android projects?
r
Anvil works fine for JVM project, Android is not required. This issue probably happens because you’re using an old Gradle version. Which version are you using?
d
7.0.2...
r
Which Anvil version?
d
The newest, I was just trying it out, and I got that error...
r
Oh gosh, that’s a bug. I’ll have a fix in a second, but in the meantime try Anvil 2.3.0. The changes in 2.3.1 aren’t important to you probably either. I’m sorry about the trouble
👍🏼 1
I just released a new version and this issue should be fixed https://github.com/square/anvil/releases/tag/v2.3.2
👍🏼 1
👍 1