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

nrobi

11/12/2019, 8:07 AM
Hey, in my common I have three targets: iOS, android, jvm(for backend). For some reason I’m getting multiple errors, related to
kotlin-stdlib
, however in my
commonMain
sourceSet I’ve added the dependency. Anyone with some help?
a

Artyom Degtyarev [JB]

11/12/2019, 8:14 AM
Hi! Can you share the buildscript?
n

nrobi

11/12/2019, 8:40 AM
a

Artyom Degtyarev [JB]

11/12/2019, 9:29 AM
Please try to add something like this to the common one:
Copy code
sourceSets["jvmMain"].dependencies {
        implementation(kotlin("stdlib"))
}
n

nrobi

11/12/2019, 9:32 AM
I’ve just tried, didn’t help 😞
a

Artyom Degtyarev [JB]

11/12/2019, 2:32 PM
Can you please check, on what task is this happening? Also, maybe source set names are clashing, please try to reproduce it with another project name.
k

Kurt Renzo Acosta

11/12/2019, 3:29 PM
Not sure but one of the problems I encountered before was the directory for Android. I had to explicitly set them in the android block to achieve
androidMain
Copy code
android {
    sourceSets {
        getByName("main") {
            manifest.srcFile("src/androidMain/AndroidManifest.xml")
            java.srcDirs("src/androidMain/kotlin")
            res.srcDirs("src/androidMain/res")
        }
    }
}

kotlin {
    ...
    android()
    ...
}
n

nrobi

11/13/2019, 5:55 AM
@Artyom Degtyarev [JB] on the
compileKotlinJvm
a

Artyom Degtyarev [JB]

11/13/2019, 8:01 AM
Try to provide all targets with with non-default names and specify all source sets explicitly. Also, I’d ask you to create a reproducer, if it is possible.
👍 1