Ionic-cli: Build fails on Xcode 9.0.0. Locating signing assets failed

Created on 25 Sep 2017  路  23Comments  路  Source: ionic-team/ionic-cli

Description:
Since updating to Xcode 9 i'm having this issue when building my iOS app for release.

This output from the terminal caught my eye: Locating signing assets failed.
I've read about this new exportOptions.plist file in Xcode 9 and after build the contents of it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>development</string>
  </dict>
</plist>

I've tried manipulating it manually but it changes back after the build.

I even tried creating an entire new Ionic project from scratch but with the same result

Steps to Reproduce:

  • Create new Ionic project
  • Add ios platform
  • Open project in Xcode and add valid provisioning profiles for dev and release (no automatic signing)
  • run ionic cordova build ios --prod --release

Output:

 ** ARCHIVE SUCCEEDED **

        2017-09-25 10:43:34.672 xcodebuild[13360:16241153] [MT] IDEDistribution: 
        -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path 
        '/var/folders/kr/rdgzgkfn0dq695j01249gkh40000gn/T/Kalmar 脰land 
        Airport_2017-09-25_10-43-34.671.xcdistributionlogs'.
        2017-09-25 10:43:34.759 xcodebuild[13360:16241153] [MT] IDEDistribution: Step failed: 
        <IDEDistributionSigningAssetsStep: 0x7fae3b9a0370>: Error 
        Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." 
        UserInfo={NSLocalizedDescription=Locating signing assets failed., 
        IDEDistributionSigningAssetStepUnderlyingErrors=(
             "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"Kalmar O\U0308land Airport.app\" 
        requires a provisioning profile.\" UserInfo={NSLocalizedDescription=\"Kalmar O\U0308land 
        Airport.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to 
        the \"provisioningProfiles\" dictionary in your Export Options property list.}"
        )}
        error: exportArchive: "Kalmar 脰land Airport.app" requires a provisioning profile.

        Error Domain=IDEProvisioningErrorDomain Code=9 ""Kalmar 脰land Airport.app" requires a 
        provisioning profile." UserInfo={NSLocalizedDescription="Kalmar 脰land Airport.app" requires a 
        provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" 
        dictionary in your Export Options property list.}

        ** EXPORT FAILED **

        Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,Kalmar 脰land 
        Airport.xcarchive,-exportOptionsPlist,/Users/timmyrosen/Sites/kalmar-airport/platforms/ios/exportOptions.plist,-exportPath,/Users/timmyrosen/Sites/kalmar-airport/platforms/ios/build/device

My ionic info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : ios 4.4.0
    Ionic Framework    : ionic-angular 3.6.1

System:

    ios-deploy : 1.9.1 
    Node       : v8.4.0
    npm        : 5.3.0 
    OS         : macOS Sierra
    Xcode      : Xcode 9.0 Build version 9A235 

Misc:

    backend : legacy

Anyone else experienced this?

Most helpful comment

@pksorensen Of course. cordova-ios is a npm package. It's installed automatically by ionic/cordova when you do "ionic cordova platform add ios"
To fix the current issues with xCode9, you have to install cordova-ios manually and do it before you add the ios platform. By doing that, when you add the ios platform, it will use the custom package instead of installing the official version.

To install the cordova-ios fork do :
npm install https://github.com/jrryhrtn/cordova-ios.git --save

All 23 comments

@timmyrosen You might try asking on the Ionic Forum or stack overflow, because you'll get more people to see it. The only one who'll see this is me, really, and I haven't looked into Xcode 9 much yet.

I do know that generally configuration for a Cordova project must be done _in Cordova_, not deep in the project's structure. See https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#signing-an-app

Some people avoid Cordova iOS altogether and just use Xcode.

@dwieeb Alright, I will try that, thanks!

I had a similar problem since installing xCode 9. This answer worked for me : https://stackoverflow.com/a/46370957

Steps to make it work :

@ElieSauveterre Would care to update your description for "install cordova-ios from this fork.." to be abit more informative for us noobs that dont know how to do that? :) is it a npm install command or something on the build machine?

@pksorensen Of course. cordova-ios is a npm package. It's installed automatically by ionic/cordova when you do "ionic cordova platform add ios"
To fix the current issues with xCode9, you have to install cordova-ios manually and do it before you add the ios platform. By doing that, when you add the ios platform, it will use the custom package instead of installing the official version.

To install the cordova-ios fork do :
npm install https://github.com/jrryhrtn/cordova-ios.git --save

@ElieSauveterre I tried your fork and I still got the error.

Here are the steps I did:

  1. ionic cordova platform rm ios
  2. npm install https://github.com/jrryhrtn/cordova-ios.git --save
  3. ionic cordova platform add ios
  4. ionic cordova build ios

When I try ionic info I get this:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : ios 4.6.0-dev
    Ionic Framework    : ionic-angular 3.6.1

System:

    ios-deploy : 1.9.2 
    Node       : v8.4.0
    npm        : 5.3.0 
    OS         : macOS Sierra
    Xcode      : Xcode 9.0 Build version 9A235 

Misc:

    backend : legacy

I ended up drowngrading to Xcode 8.3.3 as I couldn't find a solution to this. If anyone can confirm when this is fixed, that would be appreciated!

Ok, I got it working. My guess is it was a problem in my build.json.

@timmyrosen I'm struggling with the same issue. Would you like to provide us your build.json?

I ask for help! All projects stopped compiling, everything hangs at the start and in the console Xcode
gives an error and the application does not load further

2017-10-11 10:34:22.678412+0300 PetMDHealth[644:541289] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/2D5C2587-7A03-4388-8A6B-D2A962C9AD92/Library/Cookies/Cookies.binarycookies 2017-10-11 10:34:22.781159+0300 PetMDHealth[644:541289] Apache Cordova native platform version 4.5.0 is starting. 2017-10-11 10:34:22.782461+0300 PetMDHealth[644:541289] Multi-tasking -> Device: YES, App: YES 2017-10-11 10:34:22.798221+0300 PetMDHealth[644:541289] -[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x174048cd0 2017-10-11 10:34:22.799557+0300 PetMDHealth[644:541289] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x174048cd0' *** First throw call stack: (0x18a582fe0 0x188fe4538 0x18a589ef4 0x18a586f54 0x18a482d4c 0x100124ec4 0x100072504 0x1906b4b04 0x1906b46e0 0x1906baf60 0x1906b83fc 0x190729e68 0x10012969c 0x100072220 0x190725e48 0x19093237c 0x190937e24 0x19094c8b0 0x1909350b8 0x18c12c884 0x18c12c6f0 0x18c12caa0 0x18a53142c 0x18a530d9c 0x18a52e9a8 0x18a45eda4 0x19071efc8 0x190719c9c 0x100072110 0x18946d59c) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

@timmyrosen can you please tell me how you fix this issue? I'm facing the same.

I have "solved" it by downgrading xcode. :/

which version? what about the Xcode command line tools?

Have you tried asking this question on our forum or on our slack channel? You will get a much wider audience there, and perhaps more ppl who have run into and solved this issue.

FWIW, Xcode 9 does actually work. It has worked great for me since I installed it when it was first released. On the plus side, that means yay it works. On the down side, that means I have not run into your issue, so have not had to work through how to solve it, but that is where the wider audience may be of great benefit.

Thanks for using Ionic!

Xcode 8.3.3 and without an older version of command line tools. But this was for me only a quick and dirty solution for an older project.

screen shot 2017-10-25 at 8 02 45 pm

What to do I'm getting this :(

@ShafiqEssani

no provisioning profile specified in Xcode

http://take.ms/z69zU

@ShafiqEssani
check the list of profiles
http://take.ms/Q62oD

@ShafiqEssani or try to remove and re-add platform ios . (if you have downgraded xcode)

@navi8602, did you get the solution of your problem "NSDictionaryM cordovaSettingForKey", Please suggest me the solution, The same problem troubling me alot.

thanks @ElieSauveterre - your solution helped me alot. Since VSTS just announced that they have mac build machines i am moving to a new build machine and was wondering - is the fork still needed or is the main repository updated to include a fix? Where would I see this ?

i have same problem,, not sure why specific provisioning can't detected. I'm resolve it by use auto provisioning by xcode

Was this page helpful?
0 / 5 - 0 ratings