Christian Sousa
04/03/2020, 9:29 AMunresolved reference: platform
in a mpp project? It seems that this happens according to the weather or something like that, sometimes it works fine and I can use autocomplete for the platform
but other time it simply doesn’t. I already tried invalidating caches and restart, tried removing some folder that I saw in a random stackoverflow thread, but it still happens.Artyom Degtyarev [JB]
04/03/2020, 10:42 AMChristian Sousa
04/03/2020, 10:44 AMiosX64() // for iOS Simulator
iosArm64() // for iOS arm64 devices
sourceSets {
iosMain {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-properties-native:$serialization_version"
implementation "io.ktor:ktor-client-ios:$ktor_version"
implementation "io.ktor:ktor-client-core-native:$ktor_version"
implementation "io.ktor:ktor-client-serialization-native:$ktor_version"
}
}
configure([targets.iosX64, targets.iosArm64]) {
compilations.main {
source(sourceSets.iosMain)
}
}
}
cocoapods {
// Configure fields required by CocoaPods.
summary = "My Lib"
homepage = "<https://google.com>"
// The name of the produced framework can be changed.
// The name of the Gradle project is used here by default.
frameworkName = "MyLib"
}
Artyom Degtyarev [JB]
04/03/2020, 1:14 PMiosMain
source set is not interpteted as native sometimes. Usually IDE assume only leaf nodes of sourceSets dependency tree as a native source set, while in your case things go a bit more complicated. If this “common ios” construction is really needed for your case, maybe it would be better to use target shortcuts?