Kotlin 多平台问题:输入“org.gradle.api.tasks.Copy”财产‘标志’没有配置值

发布于 2025-01-14 21:04:45 字数 730 浏览 2 评论 0原文

我正在尝试构建一个 KMM 项目,在 Android 和 iOS 模拟器中一切正常,但当我连接 iOS 设备时,出现以下错误。

失败:构建失败并出现异常。

  • 出了什么问题: 任务“:shared:embedAndSignAppleFrameworkForXcode”的配置存在问题(类型“Copy”)。

我的 gradle 包装器属性有 7.4.1,我使用过 7.2 版本也有同样的问题。

如果有人能告诉我如何解决这个 gradle 问题以使框架库为 iOS 项目做好准备,这将非常有帮助,谢谢。

同时,如果我找到任何解决方案,我会尝试弄清楚自己会更新。

I am trying to build a KMM project everything works fine in Android also in iOS simulator but when I connect an iOS device I get the below error .

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ':shared:embedAndSignAppleFrameworkForXcode' (type 'Copy').

My gradle wrapper properties has 7.4.1, I have used 7.2 version as well same issue.

If anyone can tell me how to resolve this gradle issue to get the framework library ready for iOS project it will be very helpful thanks.

Meanwhile I ll try to figure out myself will update if I find any solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落在眉间の轻吻 2025-01-21 21:04:45

您似乎缺少 EXPANDED_CODE_SIGN_IDENTITY。如果您选择 iOS 设备,Xcode 会设置此变量。对于模拟器,在我的例子中,它将其设置为 -
Kotlin 多平台插件需要设置此变量,embedAndSignAppleFrameworkForXcode 才能正常工作此处

我认为更新 Xcode 可能会有所帮助。或者,如果未定义,您可以将 EXPANDED_CODE_SIGN_IDENTITY 设置为 -

为此,只需更新您的运行脚本阶段:

: "${EXPANDED_CODE_SIGN_IDENTITY:=-}"
./gradlew :shared:embedAndSignAppleFrameworkForXcode

希望它会有所帮助。

Looks like you are missing EXPANDED_CODE_SIGN_IDENTITY. Xcode sets this variable if you select an iOS device. For a simulator In my case, it sets it to -.
Kotlin multiplatform plugin requires this variable to be set for embedAndSignAppleFrameworkForXcode to work properly here.

I think updating Xcode may help. alternatively, you can set EXPANDED_CODE_SIGN_IDENTITY to - if it is not defined.

To do this just update your run script phase:

: "${EXPANDED_CODE_SIGN_IDENTITY:=-}"
./gradlew :shared:embedAndSignAppleFrameworkForXcode

Hopefully, it will help.

深巷少女 2025-01-21 21:04:45

答案是你需要进入“构建设置”-> “代码签名识别”并确保您拥有签名证书集。您需要确保在“签名和签名”中选择了一个团队。能力也。

Xcode 构建设置

The answer is that you need go to 'Build Settings' -> 'Code Signing Identify' and make sure that you have a signing certificate set. You'll need to make sure you have a Team selected in 'Signing & Capabilities' as well.

Xcode Build Settings

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文