32

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.

Hiren Dhamecha
  • 658
  • 5
  • 15
Vijay
  • 353
  • 1
  • 3
  • 7

8 Answers8

51

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!

Alexandre Rozier
  • 960
  • 1
  • 8
  • 21
  • 4
    This NEEDS to be added to the Cordova Commit. In fact, I'm adding it. – HipsterZipster Sep 23 '16 at 04:10
  • I am completely fine with that, I found the fix really poorly documented in the cordova-ios project, hopefully @dpogue was there :) – Alexandre Rozier Sep 23 '16 at 08:35
  • Agreed . This was merged, but I'd never realized how to use it (removing the previous 2 signing fields for provisioningProfile and signingIdentity) – HipsterZipster Sep 23 '16 at 12:12
  • 3
    But this means that still manage code signing automatically is enabled. How can I disable this box via Cordova and specify certificates separately? – Georg Heiler Sep 23 '16 at 13:19
  • Couldn't you just change `build-release.xcconfig` from `iPhone Developer` to `iPhone Distribution` – KVISH Sep 29 '16 at 22:06
  • 1
    Thank you for your post. I will try this and let you know if this works for me. Apple seems to have updated enterprise T&Cs. Awaiting it to be agreed before I can try this out. – Vijay Oct 07 '16 at 04:54
  • You also have to make sure that the bundle ID your app is using exists in your Team Developer Identifiers you can check this [here](https://developer.apple.com/account/ios/identifier/bundle) – Alexandre Rozier Oct 07 '16 at 13:24
  • for me is working this: cordova platform add ios@https://github.com/apache/cordova-ios – stackdave Oct 12 '16 at 03:12
  • The documentation for this is available here: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#using-flags – Tyler Dec 15 '16 at 18:52
  • 1
    This has tremendously helped. I've also had to adjust the minimum build version and it'd be great if there were extra flags in Cordova to assign, but for now, I just edited project.pbxproj. – Tom Pace Apr 15 '17 at 03:23
  • Beyond editing project.pbxproj in the primary project folder, I've also edited IPHONEOS_DEPLOYMENT_TARGET in platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj ... to prevent an error at runtime: `dyld: Symbol not found: ___NSDictionary0__`, because current CordovaLib project has 9.0, and my device has 8.x – Tom Pace Apr 15 '17 at 04:45
  • 1
    Thanks, was really helpful. – Akram Jul 19 '17 at 13:29
  • "which is in the master branch of their iOS platform repository", when? what's the version? – Christian Vincenzo Traina Jan 13 '21 at 09:50
  • 1
    Dude, thank you very much! I was already thinking that I wouldn't be able to do a signed ios build without xcode. Thank you so much! – José Damião Sep 19 '22 at 22:36
9

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!

dpogue
  • 553
  • 5
  • 7
  • 1
    Thanks for your suggestion and the link. I followed it and got a different error this time around. I mentioned the development team ID belonging to me in **platforms/ios/cordova/build.xconfig** but it kept throwing an error that it could not find the app ID. I have for now went back to Xcode 7.3.1 , atleast it builds properly now and installs it. Just doesnt run the app and log contents, which is fine by me considering I debug mostly through safari. – Vijay Sep 16 '16 at 06:28
  • What if I don't have a build.json file? – Kinoli Sep 19 '16 at 00:42
  • 1
    You need to add one @kinoli – HipsterZipster Sep 23 '16 at 12:15
  • 1
    I'm new to cordova, what's the right location for the build.json file? Thanks – Daniel Sanchez May 13 '17 at 12:31
  • 1
    @DanielSanchez The build.json file goes in the root of your project, beside config.xml – dpogue May 14 '17 at 19:58
  • Thanks a lot @dpogue – Daniel Sanchez May 15 '17 at 09:51
  • Im using VS2015 with TACO. Exactly how do I check my Cordova-iOS version? Thanks. – andreszs Jul 19 '17 at 20:56
5

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.

Orion390
  • 127
  • 1
  • 8
  • Hey I want to try your solution, but where can you find the provisioning profile UID? – Gyum Fox Dec 09 '16 at 10:08
  • Download the certificate on your computer (with .mobileprovision extension) and open it with a text editor, search for UUID – Orion390 Dec 09 '16 at 20:43
5

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

 <icon src="res/ios/icon-60@3x.png" 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/icon-60@2x.png" width="120" height="120" />
        <!-- iPad -->
        <icon src="res/ios/icon-76.png" width="76" height="76" />
        <icon src="res/ios/icon-76@2x.png" width="152" height="152" />
        <!-- Spotlight Icon -->
        <icon src="res/ios/icon-40.png" width="40" height="40" />
        <icon src="res/ios/icon-40@2x.png" width="80" height="80" />
        <!-- iOS 6.1 -->
        <!-- iPhone / iPod Touch -->
        <icon src="res/ios/icon.png" width="57" height="57" />
        <icon src="res/ios/icon@2x.png" width="114" height="114" />
        <!-- iPad -->
        <icon src="res/ios/icon-72.png" width="72" height="72" />
        <icon src="res/ios/icon-72@2x.png" width="144" height="144" />
        <!-- iPhone Spotlight and Settings Icon -->
        <icon src="res/ios/icon-small.png" width="29" height="29" />
        <icon src="res/ios/icon-small@2x.png" width="58" height="58" />
        <!-- iPad Spotlight and Settings Icon -->
        <icon src="res/ios/icon-50.png" width="50" height="50" />
        <icon src="res/ios/icon-50@2x.png" width="100" height="100" />
        <!-- iPad Pro -->
        <icon src="res/ios/icon-83.5@2x.png" width="167" height="167" />
Lisa L
  • 51
  • 1
  • 1
0

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

Satish Mavani
  • 4,897
  • 2
  • 20
  • 30
0

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".

Tad Macy
  • 11
  • 4
0

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

jony89
  • 5,155
  • 3
  • 30
  • 40
0

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.

lcharbon
  • 3,030
  • 2
  • 16
  • 18