Search code examples
androidkotlinkoin

Unresolved reference startKoin in android


I have added all the dependencies of Koin to the android app, but I am not able to use the references. How to resolve this

KoinVersion

ext.koin_version = "3.5.1"

Dependencies used

implementation "io.insert-koin:koin-core:$koin_version"
implementation "io.insert-koin:koin-android:$koin_version"
implementation "io.insert-koin:koin-androidx-scope:$koin_version"
implementation "io.insert-koin:koin-androidx-viewmodel:$koin_version"

enter image description here


Solution

  • There is no version 3.5.1 for these dependencies, for similar cases you can find the issues on the Build tab after syncing with Gradle:

    enter image description here

    You can try using koin-bom dependency instead as follows:

    implementation "io.insert-koin:koin-bom:$koin_version"
    implementation "io.insert-koin:koin-core"
    implementation "io.insert-koin:koin-android"
    

    I excluded koin-androidx-scope and koin-androidx-viewmodel as it looks like they are not supported anymore. Their latest updates are from May 2021, and they are not mentioned on the official website.