Multiplatform error when building iosApp: Command PhaseScriptExecution failed with a nonzero exit code

Christopher Mathews

I am working on a multiplatform app in Kotlin on Android Studio and when I try to run the app to an iOS simulator, I get this error:

The following build commands failed:

PhaseScriptExecution [CP-User]\ Build\ shared /Users/cjm/AndroidStudioProjects/GlobeMultiplatform/build/ios/Pods.build/Debug-iphonesimulator/shared.build/Script-882AF45D8B8C4938AC461F4FBA0FE197.sh (in target 'shared' from project 'Pods')

The code in the build.gradle that sets the cocoa pods is this:

cocoapods {
    summary = "Shared"
    homepage = "Link to the Shared Module homepage"
    ios.deploymentTarget = "13"
    frameworkName = "shared"
    podfile = project.file("../iosApp/Podfile")
}

I ran pod install and it showed success but the build of the app still fails. How can I fix this error? What is causing this error? I am brand new to Kotlin and especially Kotlin Multiplatform so I apologize if this is a stupid question.

EDIT: Here's what Xcode says when running the app:

FAILURE: Build failed with an exception.

  • Where: Build file '/Users/cjm/AndroidStudioProjects/GlobeMultiplatform/androidApp/build.gradle.kts' line: 1

  • What went wrong: An exception occurred applying plugin request [id: 'com.android.application']

Failed to apply plugin 'com.android.internal.application'. Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing org.gradle.java.home in gradle.properties.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Róbert Nagy

It seems that it tries to build your code with Java 1.8, you need a Java > 11 version.

I'd look into this or other guidelines to make sure the proper JDK version is used

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Receiving this error 'Command PhaseScriptExecution failed with nonzero exit code' when building a Python/Kivy app in Xcode10.1

Xcode Flutter ScaffoldState Command PhaseScriptExecution failed with a nonzero exit code Error

"Command PhaseScriptExecution failed with a nonzero exit code" when archiving

Command PhaseScriptExecution failed with a nonzero exit code when archive

Command PhaseScriptExecution failed with a nonzero exit code when archiving

Flutter - Command PhaseScriptExecution failed with a nonzero exit code

Command PhaseScriptExecution failed with a nonzero exit code flutter

Command PhaseScriptExecution failed with a nonzero exit code - errSecInternalComponent

Flutter: Command PhaseScriptExecution failed with a nonzero exit code

Command PhaseScriptExecution failed with a nonzero exit code iOS

XCode Error PhaseScriptExecution failed with a nonzero exit code

Failed to package: Command PhaseScriptExecution failed with a nonzero exit code

Xcode 11.1 -no identity found Command PhaseScriptExecution failed with a nonzero exit code

Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code

Command PhaseScriptExecution failed with a nonzero exit code Xcode 11.3.1

Xcode 13.2 command PhaseScriptExecution failed with a nonzero exit code

Flutter iOS "replacing existing signature" "permission denied" error. Command PhaseScriptExecution failed with a nonzero exit code

Apollo iOS: Command /bin/sh failed with exit code 1 | Command PhaseScriptExecution failed with a nonzero exit code

PhaseScriptExecution failed with a nonzero exit code + Fabric

Flutter iOS build failed on real device with Command PhaseScriptExecution failed with a nonzero exit code

Xcode 10 Command PhaseScriptExecution failed with a nonzero exit code (EXPANDED_CODE_SIGN_IDENTITY: unbound variable)

"${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10

XCode Command PhaseScriptExecution failed with a nonzero exit code - Mac M1 Max

Xcode 11 Beta 7 Command PhaseScriptExecution failed with a nonzero exit code ([CP] Copy Pods Resources)

How to fix Command PhaseScriptExecution failed with a nonzero exit code on flutter run in macOS?

Command PhaseScriptExecution failed with a nonzero exit code after updating to Xcode 14.3 and MacOS 13.3

Flutter iOS - Command PhaseScriptExecution failed with a nonzero exit code - ARCHIVE APP FROM XCODE

After upgrading to Xcode 14.3, while trying to archive a Flutter app, I get "Command PhaseScriptExecution failed with a nonzero exit code"

Command CompileXIB failed with a nonzero exit code

TOP Ranking

HotTag

Archive