Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Sign Error on Xcode 8 and iOS 10 Cordova Project

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.

like image 407
Vijay Avatar asked Sep 14 '16 23:09

Vijay


People also ask

How do I manually manage signing in Xcode?

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.

Does Cordova work for iOS?

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 in Xcode?

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.


3 Answers

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!

like image 187
Alexandre Rozier Avatar answered Sep 20 '22 06:09

Alexandre Rozier


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!

like image 29
dpogue Avatar answered Sep 19 '22 06:09

dpogue


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.

like image 39
Orion390 Avatar answered Sep 20 '22 06:09

Orion390