from the xcode environment. If I hardcode one or the other (iosArm64 or iosX64) I'm able to build either on the simulator or device.
This is the line that fails:
Copy code
System.getenv("SDK_NAME")
And here's the block that sets the target:
Copy code
//select iOS target platform depending on the Xcode environment variables
val iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
::iosArm64
else
::iosX64
iOSTarget("ios") {
binaries {
framework {
baseName = "SharedCode"
}
}
}
a
Artyom Degtyarev [JB]
09/24/2019, 12:31 PM
Please make sure that the Xcode sets the variable correctly. What is the value of
System.getenv("SDK_NAME")
?
m
Miguel Fermin
09/24/2019, 1:54 PM
Sorry, I got caught up in meetings...
I found the problem. Silly me copied and pasted the Run Script from the tutorial and didn't realize the need for a new line (or &&) after cd'ing to the framework directory before invoking the ./gradlew task.
It's all good now. Thanks!