This is how I\'m trying to provide my ViewModelFactory:
@Suppress(\"UNCHECKED_CAST\")
@Singleton
class ViewModelFactory @Inject constructor(
I faced the same issue recently. Version Kotlin:1.3.40 Dagger:2.23.2 I tried following the solutions mentioned in this post and here
but none seemed to work. The annotation processor of Dagger is not playing well with KAPT and for the same reason, the builds are failing. This is also updated on Kotlin issue too.
For me, converting both the ViewModelKey and ViewModelFactory to java worked.
For Dagger, the tracking issue can be found here.
Update
Adding @JvmSuppressWildcards fixed the issue. Code looks like this:
private val providers: Map, @JvmSuppressWildcards Provider>