I get this error when trying to create a view model factory class. I have no idea to fix this. Can anyone help me please?
Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option
class NewTagViewModelFactory(private val repository: PomodoroRepository) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
if (modelClass.isAssignableFrom(NewTagViewModel::class.java)) {
@Suppress("UNCHECKED_CAST")
return NewTagViewModel(repository) as T
}
throw IllegalArgumentException("Unknown ViewModel class")
}
}