Open GuilhE opened 2 months ago
I've found this:
My project has 2 modules shared
and shared-ui
(depends on first). Atomicfu is used by the first:
.shared-appleMain.cinteropLibraries.json
:
[
{
"moduleId": "org.jetbrains.kotlinx:atomicfu:0.25.0",
"file": ".../.kotlin/metadata/kotlinTransformedCInteropMetadataLibraries/org.jetbrains.kotlinx-atomicfu-0.25.0-iosMain-cinterop/org.jetbrains.kotlinx_atomicfu-cinterop-interop-l0JTDg.klib",
"sourceSetName": "iosMain"
}, ...
]
.shared-ui-appleMain.cinteropLibraries.json
:
[
{
"moduleId": "org.jetbrains.kotlinx:atomicfu:0.23.2",
"file": ".../.kotlin/metadata/kotlinTransformedCInteropMetadataLibraries/org.jetbrains.kotlinx-atomicfu-0.23.2-iosMain-cinterop/org.jetbrains.kotlinx_atomicfu-cinterop-interop-l0JTDg.klib",
"sourceSetName": "iosMain"
}, ...
]
Questions:
0.23.2
coming from?@GuilhE could you please share some project where the problem reproduces? It would help a lot with tracking the root cause down.
@GuilhE could you please share some project where the problem reproduces? It would help a lot with tracking the root cause down.
Yes, you can try this: https://github.com/GuilhE/WhosNext just bump:
Thanks!
Adding an explicit dependency on atomicfu:0.25.0 to shared's commonMain dependencies seems to solve the issue:
commonMain.dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.serialization)
implementation(libs.kmp.settings)
api(libs.kmp.viewmodel)
api(libs.kmp.koin.core)
api(libs.kmp.kermit)
implementation("org.jetbrains.kotlinx:atomicfu:0.25.0")
}
But it's unclear to me where the problematic dependency on 0.23.2
is coming from.
Adding an explicit dependency on atomicfu:0.25.0 to shared's commonMain dependencies seems to solve the issue:
If I remember correctly, recently, the dependency configuration was moved from "lib dependency" to "plugin dependency" correct? In other words, it should not be necessary to add it as a commonMain dependency. 🤔
If I remember correctly, recently, the dependency configuration was moved from "lib dependency" to "plugin dependency" correct?
That's correct. And that's how the project got Dependency path ':shared:unspecified' --> 'org.jetbrains.kotlinx:atomicfu:0.25.0'
. It's unclear, thought, where the constraint on 0.23.2
is coming from, but explicit dependency on 0.25.0
lifts it off.
@fzhinkin I've another project and I've noticed the same atomicfu
reference of 0.23.2
version inside .kotlin
folder. I've no atomicfu
definition in my project. The depencies are:
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.ui)
}
So, is it compose-multiplatform
introducing this problem?
@GuilhE Yes, the dependency on 0.23.2
is indeed from the Compose libraries.
I guess, the problem has something to do with that fact that AtomicFU plugin works only with Kotlin JVM and Multiplatform plugins, but it does not support Android Gradle plugin.
So, I was wrong about
And that's how the project got
Dependency path ':shared:unspecified' --> 'org.jetbrains.kotlinx:atomicfu:0.25.0'.
as it should not be configured by the plugin (or, to be more precise, that dependency should only be added to native targets).
I'm yet to figure out how releaseCompileClasspath
and other relative configurations are set.
Should I submit a request for the compose-multiplatform
team to update their version to match the latest atomicfu
release while the atomicfu
team addresses the dependency issue?
Should I submit a request for the
compose-multiplatform
team to update their version to match the latestatomicfu
release while theatomicfu
team addresses the dependency issue?
Updating version in Compose won't solve the problem in general. So I don't think this issue should drive version updates in Compose.
Related issue: https://github.com/Kotlin/kotlinx-atomicfu/issues/145
Related YouTrack issue: https://youtrack.jetbrains.com/issue/CMP-5831
atomicfu
was already on0.25.0
and working, but suddenly when running for Android I'm getting:project
build.gradle
:shared
build.gradle
:No problem running for iOS, Desktop and Wasm.
ps: I've checked if any of other dependencies uses
atomicfu
and they do, but none on0.23.2
they are on0.24.0
. And as I said it was already working. The only change was bumping Kotlin version, but I've rolledback and the problem still remains. Cleaned all caches too. 🤷🏼