InsertKoinIO / koin

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

Koin(-core-viewmodel) 4.0.0-RC1 appears to depend on compose 1.7.0-alpha01 #1929

Closed mikepenz closed 2 months ago

mikepenz commented 3 months ago

Describe the bug

Koin 4.0.0-RC1 contains a commit upgrading to compose-navigation 2.8.0-alpha08 - This change results in koin depending on compose 2.7.0-alpha01.

Based on other version definitions in the toml I believe the project means to still depend on compose 1.6.11 instead for the 4.0.0 release.

Unfortunately, using compose-navigation 2.8.0-alpha08 forces the project to Compsoe 1.7.0

Screenshot 2024-07-30 at 15 20 26

While compose-navigation 2.7.0-alpha07 would use compose 1.6.11

Screenshot 2024-07-30 at 15 20 10

This incompatibility results in projects built with compose 1.6.11 failing for example due to:

Exception in thread "main" java.lang.NoSuchMethodError: 'void androidx.compose.runtime.Composer.startReplaceGroup(int)'
    at androidx.compose.ui.platform.PlatformLocalization_desktopKt.defaultPlatformLocalization(PlatformLocalization.desktop.kt)

(or other APIs which were changed like ripple, ..)

To Reproduce 1) Upgrade the project to Koin 4.0.0-RC01 2) Retrieve dependencies with gradles dependencies task 3) Observe compose 1.7.0-alpha01 is pulled in via the navigation plugin

+--- io.insert-koin:koin-compose-viewmodel -> 4.0.0-RC1
|    +--- io.insert-koin:koin-compose:4.0.0-RC1 (*)
|    +--- io.insert-koin:koin-core-viewmodel:4.0.0-RC1
|    |    +--- io.insert-koin:koin-core:4.0.0-RC1 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.0
|    |    |    +--- org.jetbrains.androidx.core:core-bundle:1.0.0
|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.23 -> 2.0.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.savedstate:savedstate:1.2.0
|    |    |    |    +--- androidx.arch.core:core-common:2.2.0 (*)
|    |    |    |    +--- org.jetbrains.androidx.core:core-bundle:1.0.0 (*)
|    |    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.0 (*)
|    |    |    |    +--- org.jetbrains.compose.annotation-internal:annotation:1.6.10 -> 1.7.0-alpha01 (*)
|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.23 -> 2.0.0 (*)
|    |    |    +--- org.jetbrains.compose.annotation-internal:annotation:1.6.10 -> 1.7.0-alpha01 (*)
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.23 -> 2.0.0 (*)
|    |    +--- org.jetbrains.androidx.core:core-bundle:1.0.0 (*)
|    |    +--- org.jetbrains.androidx.savedstate:savedstate:1.2.0 (*)
|    |    +--- org.jetbrains.androidx.navigation:navigation-common:2.8.0-alpha08
|    |    |    +--- org.jetbrains.androidx.core:core-bundle:1.0.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-runtime:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.savedstate:savedstate:1.2.0 (*)
|    |    |    +--- org.jetbrains.compose.annotation-internal:annotation:1.7.0-alpha01 (*)
|    |    |    +--- org.jetbrains.compose.collection-internal:collection:1.7.0-alpha01 (*)
|    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.24 -> 2.0.0 (*)
|    |    |    \--- org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.2 -> 1.7.1 (*)
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.0 (*)
|    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0
|    |    +--- org.jetbrains.androidx.core:core-bundle:1.0.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.savedstate:savedstate:1.2.0 (*)
|    |    +--- org.jetbrains.compose.runtime:runtime:1.6.10 -> 1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.compose.runtime:runtime-saveable:1.6.10 -> 1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.compose.ui:ui:1.6.10 -> 1.7.0-alpha01 (*)
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.23 -> 2.0.0 (*)
|    +--- org.jetbrains.androidx.navigation:navigation-compose:2.8.0-alpha08
|    |    +--- org.jetbrains.androidx.core:core-bundle:1.0.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-runtime:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.0 (*)
|    |    +--- org.jetbrains.androidx.navigation:navigation-common:2.8.0-alpha08 (*)
|    |    +--- org.jetbrains.androidx.navigation:navigation-runtime:2.8.0-alpha08
|    |    |    +--- org.jetbrains.androidx.core:core-bundle:1.0.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-runtime:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.0 (*)
|    |    |    +--- org.jetbrains.androidx.navigation:navigation-common:2.8.0-alpha08 (*)
|    |    |    +--- org.jetbrains.androidx.savedstate:savedstate:1.2.0 (*)
|    |    |    +--- org.jetbrains.compose.annotation-internal:annotation:1.7.0-alpha01 (*)
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.24 -> 2.0.0 (*)
|    |    +--- org.jetbrains.androidx.savedstate:savedstate:1.2.0 (*)
|    |    +--- org.jetbrains.compose.animation:animation:1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.compose.animation:animation-core:1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.compose.foundation:foundation-layout:1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.compose.runtime:runtime:1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.compose.runtime:runtime-saveable:1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.compose.ui:ui:1.7.0-alpha01 (*)
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.24 -> 2.0.0 (*)
|    |    \--- org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.2 -> 1.7.1 (*)

Expected behavior

Koin module and version:

Snippet or Sample project to help reproduce Add a snippet or even a small sample project to hel reproduce your case.

mikepenz commented 3 months ago

Opened a PR here: https://github.com/InsertKoinIO/koin/pull/1930

arnaudgiuliani commented 2 months ago

library is been downgraded