https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
t

tylerwilson

06/25/2020, 2:10 PM
Anybody here been able to add macosX64 to multiplatform library to target catalyst? If so, could you share your build.gradle snippets?
Never mind. I was able to add it to the build file like so:
Copy code
def buildForARM = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm"
    if (buildForARM) {
        iosArm32("ios32")
        iosArm64("ios64")

        def iosMain = sourceSets.maybeCreate("iosMain")
        sourceSets["ios64Main"].dependsOn(iosMain)
        sourceSets["ios32Main"].dependsOn(iosMain)

    } else {
        iosX64("ios")
        macosX64("macosX64")

        def iosMain = sourceSets.maybeCreate("iosMain")
        sourceSets["macosX64Main"].dependsOn(iosMain)
    }
but it fails in the build do to trying to build the iOS source as macOS/AppKit source:
Copy code
Showing All Messages
e: library/PlatformIos.kt: (10, 17): Unresolved reference: UIKit
So I guess some tweaking under the covers is needed here.
t

Thomas

06/25/2020, 4:03 PM
Unfortunately Mac Catalyst is not supported yet: https://github.com/JetBrains/kotlin-native/issues/3713
t

tylerwilson

06/25/2020, 4:05 PM
yeah, i saw that. 😞 subscribed and upvoted it. i do hope they can support in 1.4. dont want to convert all my Kotlin to Swift. 😕