https://kotlinlang.org logo
Title
d

darkmoon_uk

02/20/2021, 1:48 PM
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

louiscad

02/21/2021, 12:53 PM
Can you kotl.in/issue it?
c

crumpf

02/22/2021, 2:44 PM
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
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

louiscad

02/22/2021, 2:46 PM
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

kpgalligan

02/22/2021, 7:40 PM
We've had to back off HMPP in library builds. Not sure how that impacts downstream projects using HMPP, but hopefully the situation improves.