3

我创建了一个项目来演示 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 上的项目点击这里。请查看并帮助我找到错误。

提前致谢。

4

1 回答 1

2

您需要至少使用 Kotlin 1.5.20embedAndSignAppleFrameworkForXcode才能使用(更多信息在https://blog.jetbrains.com/kotlin/2021/07/multiplatform-gradle-plugin-improved-for-connecting-kmm-modules/ )

于 2021-08-04T10:54:16.553 回答