Using Anvil 2.5.0 with Dagger version 2.52 I have no issues. But updating Dagger to 2.53 (and doing no other changes to the project) gives issues when @LazyClassKey is used:
/something/build/generated/source/kapt/debugAndroidTest/something/DaggerSomethingComponent.java:41: error: cannot find symbol
import something.SomethingElse_Module_ProvideType_LazyMapKey;
^
symbol: class SomethingElse_Module_ProvideType_LazyMapKey
The SomethingElse_Module is generated by my own code generator via Anvil.
// Generated by Anvil.
// https://github.com/square/anvil
@file:Suppress(
"DEPRECATION",
"OPT_IN_USAGE",
"OPT_IN_USAGE_ERROR",
)
package something
import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import dagger.multibindings.IntoMap
import dagger.multibindings.IntoSet
import dagger.multibindings.LazyClassKey
import dagger.multibindings.StringKey
import kotlin.String
import kotlin.Suppress
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.polymorphic
import kotlinx.serialization.modules.subclass
@Module
@ContributesTo(AppScope::class)
public object SomethingElse_Module {
@Provides
@IntoMap
@LazyClassKey(SomethingElse::class)
public fun provideType(): String =
"SomethingElse"
}
Note that I had to rename/hide some sensitive details here. Hopefully it still makes sense.
I can work on a reproducer, if required. Didn't dig down into it just yet and wanted to open the issue in the meantime.
Using Anvil
2.5.0with Dagger version2.52I have no issues. But updating Dagger to2.53(and doing no other changes to the project) gives issues when@LazyClassKeyis used:The
SomethingElse_Moduleis generated by my own code generator via Anvil.Note that I had to rename/hide some sensitive details here. Hopefully it still makes sense.
I can work on a reproducer, if required. Didn't dig down into it just yet and wanted to open the issue in the meantime.