https://kotlinlang.org logo
#koin
Title
# koin
p

Piotr Prus

09/19/2023, 10:36 PM
I have issues with koin-annotations in KMP project. I cannot build release version of app. I tried to build
hello-kmp
(https://github.com/InsertKoinIO/hello-kmp/tree/annotations) sample and have the same issue. Stacktrace in 🧵
Copy code
> Task :androidApp:compileReleaseKotlin FAILED
e: file:///Users/piotrprus/AndroidStudioProjects/hello-kmp/androidApp/build/generated/ksp/debug/kotlin/org/koin/ksp/generated/AndroidModuleGencom$example$helloworldkmp$android$di.kt:7:12 Conflicting declarations: public val com_example_helloworldkmp_android_di_AndroidModule: Module, public val com_example_helloworldkmp_android_di_AndroidModule: Module
e: file:///Users/piotrprus/AndroidStudioProjects/hello-kmp/androidApp/build/generated/ksp/debug/kotlin/org/koin/ksp/generated/AndroidModuleGencom$example$helloworldkmp$android$di.kt:10:63 Conflicting declarations: public val AndroidModule.module: Module, public val AndroidModule.module: Module
e: file:///Users/piotrprus/AndroidStudioProjects/hello-kmp/androidApp/build/generated/ksp/debug/kotlin/org/koin/ksp/generated/AndroidModuleGencom$example$helloworldkmp$android$di.kt:10:108 Overload resolution ambiguity: 
public val com_example_helloworldkmp_android_di_AndroidModule: Module defined in org.koin.ksp.generated in file AndroidModuleGencom$example$helloworldkmp$android$di.kt
public val com_example_helloworldkmp_android_di_AndroidModule: Module defined in org.koin.ksp.generated in file AndroidModuleGencom$example$helloworldkmp$android$di.kt
e: file:///Users/piotrprus/AndroidStudioProjects/hello-kmp/androidApp/build/generated/ksp/release/kotlin/org/koin/ksp/generated/AndroidModuleGencom$example$helloworldkmp$android$di.kt:7:12 Conflicting declarations: public val com_example_helloworldkmp_android_di_AndroidModule: Module, public val com_example_helloworldkmp_android_di_AndroidModule: Module
e: file:///Users/piotrprus/AndroidStudioProjects/hello-kmp/androidApp/build/generated/ksp/release/kotlin/org/koin/ksp/generated/AndroidModuleGencom$example$helloworldkmp$android$di.kt:10:63 Conflicting declarations: public val AndroidModule.module: Module, public val AndroidModule.module: Module
e: file:///Users/piotrprus/AndroidStudioProjects/hello-kmp/androidApp/build/generated/ksp/release/kotlin/org/koin/ksp/generated/AndroidModuleGencom$example$helloworldkmp$android$di.kt:10:108 Overload resolution ambiguity: 
public val com_example_helloworldkmp_android_di_AndroidModule: Module defined in org.koin.ksp.generated in file AndroidModuleGencom$example$helloworldkmp$android$di.kt
public val com_example_helloworldkmp_android_di_AndroidModule: Module defined in org.koin.ksp.generated in file AndroidModuleGencom$example$helloworldkmp$android$di.kt
e: file:///Users/piotrprus/AndroidStudioProjects/hello-kmp/androidApp/src/main/java/com/example/helloworldkmp/android/MainApplication.kt:18:51 Overload resolution ambiguity: 
public val AndroidModule.module: Module defined in org.koin.ksp.generated in file AndroidModuleGencom$example$helloworldkmp$android$di.kt
public val AndroidModule.module: Module defined in org.koin.ksp.generated in file AndroidModuleGencom$example$helloworldkmp$android$di.kt
a

arnaud.giuliani

09/20/2023, 6:01 AM
you need to clean build, and build only release or debug on Android. Else it generates code in both flavour directory
👍 1
6 Views