我创建了一个演示Kotlin Multiplatform Mobile的项目,成功地在Android和iOS设备上构建和运行。之后,我在iOS上重新运行该项目,结果出现了错误。
> Configure project :shared
Kotlin Multiplatform Projects are an Alpha feature. See: https://kotlinlang.org/docs/reference/evolution/components-stability.html. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
* Try:
Run gradlew tasks to get a list of available tasks. 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
BUILD FAILED in 1s
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Volumes/Data/ProjectsKMM/DemoNetworkAPI/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh
(1 failure)
这是我在Github上的项目 点击这里。请查看并帮我找出错误。
谢谢您提前的帮助。
gradlew tasks --all
中,它是特定于环境的 - 它只能在安装有XCode的MacOS上使用。build.gradle(.kts)
- 我们尝试在ios模拟器上运行它并且得到了相同的错误,直到我们取消注释了iosSimulatorArm64
的行,然后它才能正常工作。