Update to Kotlin 1.3.30 breaks build with Dagger 2.21
This bug was already reported by someone on GitHub and on YouTrack. This should be fixed once Kotlin version 1.3.31 gets released.
Update: Kotlin 1.3.31 is out, so make sure to update your Kotlin version!
The workaround for Kotlin 1.3.30 listed on GitHub is to use a Java annotation instead of Kotlin for ViewModelKey
, or you may downgrade back to Kotlin 1.3.21.
/**
* Workaround in Java due to Dagger/Kotlin not playing well together as of now
* https://github.com/google/dagger/issues/1478
*/
@MapKey
@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ViewModelKey {
Class<? extends ViewModel> value();
}