Xcode 8 和 iOS 10 Cordova 项目上的代码签名错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39501020/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Code Sign Error on Xcode 8 and iOS 10 Cordova Project
提问by Vijay
I have a cordova project which I build and run locally deploying it on my iPhone and android device.
我有一个cordova项目,我在我的iPhone和Android设备上构建并在本地运行它。
However after i have upgraded to Xcode 8
and my iPhone iOS
to iOS 10
, I cant build ipas locally. It fails with the following error.
我已经升级到但是之后Xcode 8
,我的iPhoneiOS
来iOS 10
,我不能在当地建立IPAS。它失败并出现以下错误。
=== BUILD TARGET * OF PROJECT *WITH CONFIGURATION Debug ===
=== BUILD TARGET * OF PROJECT *WITH CONFIGURATION Debug ===
Check dependencies Signing for "*" requires a development team. Select a development team in the project editor. **Code signing is required for product type 'Application' in SDK 'iOS 10.0'
检查依赖关系签名“ *”需要一个开发团队。在项目编辑器中选择一个开发团队。**SDK“iOS 10.0”中的产品类型“应用程序”需要代码签名
This was working perfectly before the update. After the update the build for iOS
fails.
这在更新之前运行良好。更新后构建iOS
失败。
The relevant version numbers for the project are
该项目的相关版本号是
ios-deploy -V - 1.8.6
xcodebuild -version - Xcode 8.0 Build version 8A218a
I have got my Xcode
setup with proper certificates and provisioning profiles.
我已经Xcode
使用适当的证书和配置文件进行了设置。
回答by Alexandre Rozier
As dpogue pointed out, cordova fixed this issue with the commit
正如 dpogue 指出的,cordova 通过提交修复了这个问题
92a62997adb3c8512328d5a0ae42fe5d156291f1
92a62997adb3c8512328d5a0ae42fe5d156291f1
which is in the master branch of their iOS platform repository.
它位于其 iOS 平台存储库的主分支中。
To benefit from this fix, you'll have to install the latest dev version like this
要从此修复中受益,您必须像这样安装最新的开发版本
cordova platform remove ios && cordova platform add https://github.com/apache/cordova-ios.git
And you need to add a build.json
file to your project root that looks like this
并且您需要将一个build.json
文件添加到您的项目根目录中,如下所示
{
"ios": {
"debug": {
"developmentTeam": "YOURTEAMID"
},
"release": {
"developmentTeam": "YOURTEAMID"
}
}
}
You can get your Team ID here: https://developer.apple.com/account/#/membership
您可以在此处获取您的团队 ID:https: //developer.apple.com/account/#/membership
Now run your build
现在运行你的构建
cordova run ios --device
... or specifying your build.json
...或指定您的 build.json
cordova run --buildConfig=build.json ios --device
and it should work!
它应该工作!
回答by dpogue
I wrote about the workaround I used to resolve this:
https://dpogue.ca/articles/cordova-xcode8.html
我写了我用来解决这个问题的解决方法:https:
//dpogue.ca/articles/cordova-xcode8.html
To recap, you need to specify your developer team ID. In the next version of Cordova-iOS, you can do this with developerTeam
in your build.json file. I have a hookavailable in the meantime.
回顾一下,您需要指定您的开发人员团队 ID。在 Cordova-iOS 的下一版本中,您可以developerTeam
在 build.json 文件中执行此操作。在此期间,我有一个挂钩可用。
You also need to set your code signing identity to "iPhone Developer", even for release builds. Do this with codeSignIdentity
in your build.json.
您还需要将您的代码签名身份设置为“iPhone 开发人员”,即使对于发布版本也是如此。codeSignIdentity
在您的 build.json 中执行此操作。
You should not need to specify a provisioning profile, Xcode will automatically handle that when it has the team ID.
您不需要指定配置文件,Xcode 会在它具有团队 ID 时自动处理。
Hope that helps!
希望有帮助!
回答by Lisa L
This works for me
这对我有用
"ios": {
"release": {
"developmentTeam": "yourdevteamid",
"packageType": "app-store",
"provisioningProfile": "yourprovfileUUID"
}
}
}
If I add "codeSignIdentity": "iPhone Development", it doesn't work , so remove codeSignIdentity in the build.json file. I also had to add all icon to config.xml
如果我添加 "codeSignIdentity": "iPhone Development",它不起作用,所以在 build.json 文件中删除 codeSignIdentity。我还必须将所有图标添加到 config.xml
<icon src="res/ios/[email protected]" width="180" height="180" />
<!-- iOS 7.0+ -->
<!-- iPhone / iPod Touch -->
<icon src="res/ios/icon-60.png" width="60" height="60" />
<icon src="res/ios/[email protected]" width="120" height="120" />
<!-- iPad -->
<icon src="res/ios/icon-76.png" width="76" height="76" />
<icon src="res/ios/[email protected]" width="152" height="152" />
<!-- Spotlight Icon -->
<icon src="res/ios/icon-40.png" width="40" height="40" />
<icon src="res/ios/[email protected]" width="80" height="80" />
<!-- iOS 6.1 -->
<!-- iPhone / iPod Touch -->
<icon src="res/ios/icon.png" width="57" height="57" />
<icon src="res/ios/[email protected]" width="114" height="114" />
<!-- iPad -->
<icon src="res/ios/icon-72.png" width="72" height="72" />
<icon src="res/ios/[email protected]" width="144" height="144" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="res/ios/icon-small.png" width="29" height="29" />
<icon src="res/ios/[email protected]" width="58" height="58" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="res/ios/icon-50.png" width="50" height="50" />
<icon src="res/ios/[email protected]" width="100" height="100" />
<!-- iPad Pro -->
<icon src="res/ios/[email protected]" width="167" height="167" />
回答by Orion390
I had the same problem with xCode 8 on an Apache Cordova build for iOS, tried every solution i could find with no results, the only thing that worked was to specify the development team, package type and provisioning file in the build.son file like this:
我在用于 iOS 的 Apache Cordova 构建上的 xCode 8 遇到了同样的问题,尝试了我能找到的所有解决方案但没有结果,唯一有效的是在 build.son 文件中指定开发团队、包类型和配置文件,如这个:
{
"ios": {
"release": {
"developmentTeam": "yourdevteamid",
"packageType": "app-store",
"provisioningProfile": "yourprovfileUUID"
}
}
}
Many postst suggest specyfing the "codeSignIdentity": "iPhone Developer", but that gave another error, only this configuration worked for me (maybe something with how the development certificates were created?), hope it helps someone.
许多帖子建议指定“codeSignIdentity”:“iPhone Developer”,但这又出现了另一个错误,只有这个配置对我有用(也许与开发证书的创建方式有关?),希望对某人有所帮助。
回答by Tad Macy
Had similar issue after upgrading Xcode 8.2.1 and companion Xcode command-line tools.
升级 Xcode 8.2.1 和配套的 Xcode 命令行工具后出现类似问题。
Solution that worked for me:
对我有用的解决方案:
1) Opened Xcode Preferences -> Accounts
1) 打开 Xcode Preferences -> Accounts
2) Deleted an existing account (AppleID)
2) 删除现有帐户 (AppleID)
3) Added new Account using AppleID
3) 使用 AppleID 添加新帐户
4) Selected the new account which opens right pane display and clicked "View Details".
4) 选择打开右侧窗格显示的新帐户,然后单击“查看详细信息”。
5) Generated new signing identities as needed and in particular "iOS Development". Clicked "Done".
5) 根据需要生成新的签名身份,特别是“iOS 开发”。单击“完成”。
Following that all my Cordova Apps allowed "cordova build ios".
之后我所有的 Cordova 应用程序都允许“cordova build ios”。
回答by jony89
Updating to cordova ios 4.3.1 and specifying build.json file, as mentioned above, did the trick for me (probably 4.3.0 includes the fix)
更新到cordova ios 4.3.1并指定build.json文件,如上所述,对我有用(可能4.3.0包括修复)
To update your platform :
要更新您的平台:
cordova platform update ios
cordova 平台更新 ios
回答by lcharbon
Our team's custom build script ran sudo cordova build ios
.
我们团队的自定义构建脚本运行了sudo cordova build ios
.
What worked for me was to rebuild the project without using sudo
fixing permission errors as needed. Then removed the sudo
from our build script and everything worked.
对我有用的是重建项目而不sudo
根据需要使用修复权限错误。然后sudo
从我们的构建脚本中删除,一切正常。
** Had to specify team in xCode after first build.
** 首次构建后必须在 xCode 中指定团队。
回答by Satish Mavani
You just need to enable "Automatic manage signing" option at Xcode project settings general tab and all signing related issue will be fixed, Check out this answers of mine:
您只需要在 Xcode 项目设置常规选项卡中启用“自动管理签名”选项,所有与签名相关的问题都将得到修复,请查看我的以下答案: