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

yshrsmz

12/16/2019, 10:43 AM
Does anyone successfully configured KMP(ios & android) with 1.3.61? When I set
kotlin.mpp.enableGranularSourceSetsMetadata=true
, Some expect/actual definition does not resolve its type correctly in commonMain and android app module. When I set
kotlin.mpp.enableGranularSourceSetsMetadata=false
, androidMain does not resolve android classes My app was working fine when I used 1.3.50.
I forgot to note that it seems like just an IDE issue, the code itself seems to compiles fine
r

russhwolf

12/17/2019, 2:46 AM
What’s your module structure look like? I tend to see issues like that any time there’s any non-default sources between common and the platforms, though there’s various workarounds some people use.
y

yshrsmz

12/17/2019, 7:52 AM
I found out why after comparing a minimum working example with my project. Due to the old workaround, my sourceSets configuration was something like below
Copy code
kotlin {
  android()
  iosX64()

  sourceSets {
    androidMain {
      dependsOn commonMain
    }
    androidTest {
      dependsOn androidMain
    }
  }
}
After removing these
dependsOn
, now it seems to be resolving fine. Thanks @russhwolf !
👍 1
2 Views