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.
Open the project using Xcode. Select the root project directory, and go to the Signing and Capabilities tab. Here, you can either check Automatically manage signing or do the signing manually. If you check the Automatically manage signing checkbox, then you will just need to select the Team from the drop-down list.
You can use cordova run ios --list to see all available targets and cordova run ios --target=target_name to run application on a specific device or emulator (for example, cordova run ios --target="iPhone-6" ). You can also use cordova run --help to see additional build and run options.
What is Code Signing Identity? As per Apple, it's their security mechanism, which is used for authenticating identity. It assures users that the applications are trustworthy, and they are created by an Apple authorized source, and it hasn't tampered.
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!
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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With