可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I have a cordova project which I build and run locally deploying it on my iPhone and android device.
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.
=== 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'
This was working perfectly before the update. After the update the build for iOS fails.
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.
回答1:
As dpogue pointed out, cordova fixed this issue with the commit
92a62997adb3c8512328d5a0ae42fe5d156291f1
which is in the master branch of their iOS platform repository.
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
{ "ios": { "debug": { "developmentTeam": "YOURTEAMID" }, "release": { "developmentTeam": "YOURTEAMID" } } }
You can get your Team ID here: https://developer.apple.com/account/#/membership
Now run your build
cordova run ios --device
... or specifying your build.json
cordova run --buildConfig=build.json ios --device
and it should work!
回答2:
I wrote about the workaround I used to resolve this:
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 hook available in the meantime.
You also need to set your code signing identity to "iPhone Developer", even for release builds. Do this with codeSignIdentity in your build.json.
You should not need to specify a provisioning profile, Xcode will automatically handle that when it has the team ID.
Hope that helps!
回答3:
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
回答4:
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": { "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.
回答5:
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:
http://stackoverflow.com/questions/39568005/xcode-8-shows-error-that-provisioning-profile-doesnt-include-signing-certificat
回答6:
Had similar issue after upgrading Xcode 8.2.1 and companion Xcode command-line tools.
Solution that worked for me:
1) Opened Xcode Preferences -> Accounts
2) Deleted an existing account (AppleID)
3) Added new Account using AppleID
4) Selected the new account which opens right pane display and clicked "View Details".
5) Generated new signing identities as needed and in particular "iOS Development". Clicked "Done".
Following that all my Cordova Apps allowed "cordova build ios".
回答7:
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)
To update your platform :
cordova platform update ios
回答8:
Our team's custom build script ran 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.
** Had to specify team in xCode after first build.