With Kotlin `1.4.30` and Android Studio Canary 7 (...
# ios
d
With Kotlin
1.4.30
and Android Studio Canary 7 (+ Gradle plugin
alpha07
), I can no longer resolve iOS symbols. Have deleted
.konan
,
.gradle
, `.idea`s and reset IDE caches, but still IDE shows red for any iOS SDK symbol. Compile is OK however! Any confirmation of this issue or ideas to resolve?
l
Can you kotl.in/issue it?
c
Yeah, the iOS platform references being red-lined as errors but building ok is infuriating. There was another thread discussing this, wherein it was mentioned to try using this bit of gradle mojo
Copy code
val onPhone = System.getenv("SDK_NAME")?.startsWith("iphoneos") ?: false
    if (onPhone) {
        iosArm64("ios")
    } else {
        iosX64("ios")
    }
As seen in the KaMPKit project https://github.com/touchlab/KaMPKit/blob/master/shared/build.gradle.kts Adding that seems to have gotten me past the redline issues on the iOS side.
l
I'm on AS Canary 7 with Kotlin 1.4.30 in the project (and IDE locked at 1.4.21), using commonizer/HMPP (hierarchical multiplatform), and iOS/darwin imports work fine on my Mac.
k
We've had to back off HMPP in library builds. Not sure how that impacts downstream projects using HMPP, but hopefully the situation improves.