Kotlin 多平台问题:输入“org.gradle.api.tasks.Copy”财产‘标志’没有配置值
我正在尝试构建一个 KMM 项目,在 Android 和 iOS 模拟器中一切正常,但当我连接 iOS 设备时,出现以下错误。
失败:构建失败并出现异常。
- 出了什么问题: 任务“:shared:embedAndSignAppleFrameworkForXcode”的配置存在问题(类型“Copy”)。
类型“org.gradle.api.tasks.Copy”属性“sign”没有配置值。
原因:此属性未标记为可选且未配置任何值。
可能的解决方案:
- 为“sign”分配一个值。
- 将属性“sign”标记为可选。
请参考https://docs.gradle.org/ 7.4.1/userguide/validation_problems.html#value_not_set 有关此问题的更多详细信息。
我的 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').Type 'org.gradle.api.tasks.Copy' property 'sign' doesn't have a configured value.
Reason: This property isn't marked as optional and no value has been configured.
Possible solutions:
- Assign a value to 'sign'.
- Mark property 'sign' as optional.
Please refer to https://docs.gradle.org/7.4.1/userguide/validation_problems.html#value_not_set for more details about this problem.
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎缺少
EXPANDED_CODE_SIGN_IDENTITY
。如果您选择 iOS 设备,Xcode 会设置此变量。对于模拟器,在我的例子中,它将其设置为-
。Kotlin 多平台插件需要设置此变量,
embedAndSignAppleFrameworkForXcode
才能正常工作此处。我认为更新 Xcode 可能会有所帮助。或者,如果未定义,您可以将
EXPANDED_CODE_SIGN_IDENTITY
设置为-
。为此,只需更新您的运行脚本阶段:
希望它会有所帮助。
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:
Hopefully, it will help.
答案是你需要进入“构建设置”-> “代码签名识别”并确保您拥有签名证书集。您需要确保在“签名和签名”中选择了一个团队。能力也。
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.