I am getting a new error on my M1 when trying to r...
# multiplatform
r
I am getting a new error on my M1 when trying to run my shared library on iOS Simulator Arm64 (not an issue when running on a physical device). The command CompileSwift fails with:
Copy code
<unknown>:0: error: unable to load standard library for target 'arm64-apple-ios10.0'
I’ve tried everything suggested online, clean derived data, restart xcode, clear environment, download ios 10 simulators (there are none). I strongly suspect it’s related to errors I had earlier compiling the shared KMM framework: https://kotlinlang.slack.com/archives/C3PQML5NU/p1654109309669219 Does anyone know why this might be happening? Its pretty ambiguous and nothing online has helped so far. This seems to be a problem with the simulator target only.
l
Can you show us your gradle file ?
r
@Louis Gautier
Copy code
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
    id("com.android.library")
}

// CocoaPods requires the podspec to have a version.
version = "0.2.2"

kotlin {
    android()
    ios()
    iosSimulatorArm64()

    cocoapods {
        summary = "Somewear Multiplatform Internal Library"
        homepage = "<https://somewearlabs.com>"
        frameworkName = "SomewearShared"
        podfile = project.file("../../beretta/Podfile")
        ios.deploymentTarget = "12.4"
        xcodeConfigurationToNativeBuildType["Debug"]= org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
        xcodeConfigurationToNativeBuildType["Beta"]= org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.RELEASE
        xcodeConfigurationToNativeBuildType["Release"]= org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.RELEASE
    }

    sourceSets {

        val appcompat = "1.3.0"
        val coroutines = "1.6.0"
        val lifecycle = "2.4.0"

        val commonMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines")
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")
            }
        }
        val androidMain by getting {
            dependencies {
                // Android
                implementation("androidx.appcompat:appcompat:$appcompat")
                implementation("androidx.lifecycle:lifecycle-viewmodel:$lifecycle")
                implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle")
            }
        }

        val commonTest by getting {
            dependencies {
                implementation(kotlin("test-common"))
                implementation(kotlin("test-annotations-common"))
            }
        }

        val iosMain by getting {}

        val iosSimulatorArm64Main by getting { dependsOn(iosMain) }
    }
}

kotlin.targets.withType(KotlinNativeTarget::class.java) {
    binaries.all {
        binaryOptions["memoryModel"] = "experimental"
    }
}

android {
    compileSdk = 31
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        minSdk = 21
        targetSdk = 31
    }

    buildTypes {
        create("beta")
    }
}
Any ideas? I see other threads about the XCTestFramework path but would like to get unblocked without changing our build process for the time being.
l
Your simulator is an iOS 10 ? But yout pod file specify a minimum of 12. I have no other clue. Sorry
r
Thanks for your help so far anyway! The simulator 10 issue I have no idea since it’s not on my machine that I know of 🤦‍♀️