The KMP Gradle plugin seems to ignore excluded dep...
# multiplatform
r
The KMP Gradle plugin seems to ignore excluded dependencies when compiling native code. E.g. I add this exclusion:
Copy code
configurations.configureEach {
    exclude group: "org.jetbrains.kotlinx", module: "atomicfu"
}
This builds fine for all targets except native, e.g.
Copy code
> Task :sample:lib:compileKotlinIosSimulatorArm64 FAILED
e: Could not find "org.jetbrains.kotlinx:atomicfu-cinterop-interop" in [/Users/rwo/Development/projects/kotlin-inject-anvil, /Users/rwo/.konan/klib, /Users/rwo/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.24/klib/common, /Users/rwo/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.24/klib/platform/ios_simulator_arm64]
Is this a known issue? I tried to find anything related to this.
e
afaik removing optional dependencies only works on jvm, all other platforms will fail to link at build time (jvm is special in that a lot of the linking is performed lazily by the jvm at runtime, and if a particular class is never used then it doesn't matter if its dependencies are missing)
👍 1
for sure
compileOnly
doesn't work, https://youtrack.jetbrains.com/issue/KT-64109
r
That sounds about right what I'm seeing.