The exception "java.lang.NoClassDefFoundError: ru.il_agent.easymusic.screens.main.viewmodel.MainActivityViewModel" at start of module loading.
I have declared the viewModel in the module and I'm starting koin in Application.onCreate. With API 28 and newer that works fine. But with API 19 - doesn't.
def koin_version = '1.0.2'
implementation "org.koin:koin-core:$koin_version"
implementation "org.koin:koin-androidx-scope:$koin_version"
implementation "org.koin:koin-androidx-viewmodel:$koin_version"
val appModule = module {
viewModel { MainActivityViewModel(get(), get()) }
...
}
class Application : Application() {
override fun onCreate() {
startKoin(this, listOf(appModule))
super.onCreate()
...
}
Has nobody faced with the similar problem ? Really ?
Found that on api 21 works fine. Is it right conclusion that min api for Koin is 21 ?
The reason was that MainActivityViewModel had the method clear() which was hiding implicitly ViewModel's method with the same name and that's problem for Dalvik.
Most helpful comment
The reason was that MainActivityViewModel had the method clear() which was hiding implicitly ViewModel's method with the same name and that's problem for Dalvik.