Suppress “Used to extend current API with Koin API”
Feb 25, 2021
Annoyed of this warning?
I want to share a quick solution, how to suprress the warning in the Dependency Injection Framework Koin for Kotlin.
This is neccesary in Koin 2.2.2, but will be probably not needed any more in Koin 2.2.3.
Follow the Discussion on GitHub: https://github.com/InsertKoinIO/koin/issues/939
Kotlin JVM
Add the following snippet to your build.gradle:
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += '-Xopt-in=org.koin.core.component.KoinApiExtension'
}
}
Kotlin Android
Add the following snippet to each app module:
android {
...
kotlinOptions {
freeCompilerArgs += "-Xopt-in=org.koin.core.component.KoinApiExtension"
}
...
}