https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

r4zzz4k

09/05/2018, 2:03 PM
I'm trying to use
org.jetbrains.kotlin.multiplatform
and stumbling upon the following issue. Quoting sample repo:
A project dependency on another MPP project has the same semantics and is also resolved in a variant-aware way:
```
dependencies { implementation project(':my-mpp-lib') }
Copy code
So I have `settings.gradle` mentioning
include(":a") include(":b")
Copy code
Then in `a/build.gradle`:
plugins { id("org.jetbrains.kotlin.multiplatform") } kotlin { targets { fromPreset(presets.linuxX64, 'native') } ... }
Copy code
and in `b/build.gradle`:
plugins { id("org.jetbrains.kotlin.multiplatform") } kotlin { targets { fromPreset(presets.linuxX64, 'native') } sourceSets { commonMain { dependencies { ... implementation project(':a') } } } }
Copy code
When I try to run `./gradlew :b:compileKotlinNative`, I get the following error:
exception: java.lang.IllegalStateException: Could not find "a" in [$PROJ_DIR, $PROJ_DIR/a/build/classes/kotlin/native/main, $HOME/.konan/klib, $HOME/.konan/kotlin-native-linux-0.8.2/klib/common, $HOME/.konan/kotlin-native-linux-0.8.2/klib/platform/linux_x64]. ``` Looking into
$PROJ_DIR/a/build/classes/kotlin/native/main
I see a file named
a-native.klib
. So the question is, how can I make this work? Do I have to somehow override suffix of
klib
or dependency, or is it a bug and the plugin should do this itself?
Okay, my bad, I was creating interop klib with custom task and the same name as the module, and I forgot to mark it as transitive with
api
configuration.