Build failed in KMM project in IOS Emulator due to Xcode Run Script phase without specified outputs

I'm working on a Kotlin Multiplatform Mobile project, and while trying to build the iOS side, I'm encountering a build failure related to a script build phase. Here's the warning I'm receiving:

warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'iosApp' from project 'iosApp')

This is followed by a build failure message:

The following build commands failed:
PhaseScriptExecution Run\ Script /Users/moataz/AndroidStudioProjects/MyApplication/build/ios/ (in target 'iosApp' from project 'iosApp') (1 failure)

I am unsure how to address this warning and subsequent error within the environment. Has anyone faced a similar issue when building the iOS part of KMM projects in Android Studio? Any suggestions on how to address this or further diagnose the problem would be greatly appreciated.


  • Add this to your build.gradle.kts file in "shared module":

    if (System.getenv("XCODE_VERSION_MAJOR") == "1500") { 
        linkerOpts += "-ld64"

    Like this:

    ).forEach {
        it.binaries.framework {
            baseName = "shared"
            if (System.getenv("XCODE_VERSION_MAJOR") == "1500") {
                linkerOpts += "-ld64"

    inside the forEach loop. This is a temporary fix, it is supposed to be fixed in Kotlin 1.9.10, but I don't get that as a choice so in the meantime,this fix makes the iOS version buildable!


    Edit: Kotlin, not Gradle 1.9.10!