InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
https://insert-koin.io
Apache License 2.0
8.98k stars 712 forks source link

Multiplatform app Compilation error #2003

Closed DmitriSerhienko closed 5 days ago

DmitriSerhienko commented 6 days ago

Hi i use for KMP project Koin and in version koin = "4.0.0" have a problem with compilation on ios, but on koin = "4.0.0-RC1" all works fine.

agp = "8.3.0" ksp = "2.0.20-1.0.25" kotlin = "2.0.20" koin = "4.0.0"

and this 3 libraries: koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin"} koin-composeVM = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koin" }

Compilation error:

Task :composeApp:kspKotlinIosSimulatorArm64 FAILED error: KLIB resolver: Could not find "com.benasher44:uuid" in [/Users/customer/AndroidStudioProjects/globinomultiplatform, /Users/customer/.konan/klib, /Users/customer/.konan/kotlin-native-prebuilt-macos-aarch64-2.0.20/klib/common, /Users/customer/.konan/kotlin-native-prebuilt-macos-aarch64-2.0.20/klib/platform/ios_simulator_arm64]

ykws commented 5 days ago

@DmitriSerhienko Thank you for your report.

The difference between version 4.0.0 and 4.0.0-RC1 can be seen in the following comparison:

https://github.com/InsertKoinIO/koin/compare/4.0.0-RC1…4.0.0

One of the major changes in version 4.0.0, which I’d like to draw your attention to, is a commit that introduces Kotlin’s standard library UUID:

Screenshot 2024-09-27 at 9 42 57

https://github.com/InsertKoinIO/koin/commit/926a7b6c90275a05b8c913a88cc3f7d4d6be82c7

Please check your application if you’re using com.benasher44:uuid. It’s important to note that even if your project depends on another library that uses it, it can still be affected. For example, Kable relies on it.

When using Kotlin 2.0.20 along with Kotlin’s uuid library, including all relevant dependencies, everything should work fine.

DmitriSerhienko commented 5 days ago

@ykws i don`t use anything by tag "Uuid" or "benasher44" in my project, but i detected this dependency in my genereted fraemwork on ios

Tweener commented 4 days ago

Hey @DmitriSerhienko, I'm facing the same problem you had, with Kotlin 2.0.20. How did you detect this dependency in your generated iOS framework? And how did you solve it? Thanks!

DmitriSerhienko commented 2 days ago

@Tweener I have problem in library mirzemehdi - KMPNotifier. After cleaning gradle, studio I check scope for "Uuid" and find this dependencies in genereted for ios package in and it was generated for KMPNotifier library.

Tweener commented 2 days ago

Thank you @DmitriSerhienko ! I just opened an issue on mirzemehdi/KMPNotifier in case you'd be interested.

mirzemehdi commented 2 days ago

@DmitriSerhienko @Tweener For now temporary solution would be to add uuid library into your gradle file

implementation("com.benasher44:uuid:0.8.4")

Meanwhile, I'll bump koin version and release new version of KMPNotifier

Tweener commented 2 days ago

Thanks a lot @mirzemehdi !