Android Studio KMM 应用程序项目 - 为 ios 平台构建失败

Android Studio KMM Application project - Build for ios platform failing

我是 KMM 的初学者,刚刚在 Macbook M1 Pro 上创建了一个新的 KMM 应用程序项目。没有代码更改,这只是我正在使用的 hello world 应用程序。我已经能够为 android 平台成功构建项目,并且它在 android 模拟器上运行良好。但是,当我尝试为 ios 平台构建它时,它失败并显示以下错误消息:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':shared'.
> The project must have a target for at least one of the following platforms: ios_simulator_arm64.

* 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

BUILD FAILED in 553ms
** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution [CP-User]\ Build\ shared /Users/manajit/Projects/Learning/App/KMMExperiment/build/ios/Pods.build/Debug-iphonesimulator/shared.build/Script-4552119A071AC6BAB7327E6434237EC3.sh (in target 'shared' from project 'Pods')
(1 failure)
Command PhaseScriptExecution failed with a nonzero exit code.

目前KMM插件创建的基础应用已经注释掉了对ARM模拟器的支持,因为还有一些库还不支持。这很可能是由于 Ktor,它最近才添加了支持。

转到 shared/build.gradle.kts 并取消注释包含 iosSimulatorArm64.

的所有行