With help from all you folks in this thread - than...
# multiplatform
s
With help from all you folks in this thread - thank you! - I managed to fix it as follows: First get rid of the red-lines in the IDE, by changing
Copy code
ios()
into
Copy code
val onPhone = System.getenv("SDK_NAME")?.startsWith("iphoneos") ?: false
    if (onPhone) {
        iosArm64("ios")
    } else {
        iosX64("ios")
    }
However, this causes the
packForXcode
task configuration to fail because of this expression:
Copy code
kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode)
To fix this, change the above expression to:
Copy code
kotlin.targets.getByName<KotlinNativeTarget>("ios").binaries.getFramework(mode)
After this, you may get red-lines in the
commonMain
source-set. To fix this, disable setting the
enableGranularSourceSetsMetadata
in your
gradle.properties
, like this:
Copy code
...
#kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false