How do we manually fix "ResourceRules.plist: cannot read resources" error after xcode 6.1 upgrade? How do we manually fix "ResourceRules.plist: cannot read resources" error after xcode 6.1 upgrade? xcode xcode

How do we manually fix "ResourceRules.plist: cannot read resources" error after xcode 6.1 upgrade?


If you're using Jenkins with the XCode plugin, you can modify the 'Code Signing Resource Rules Path' variable by adding:

"CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist" 

to the

'Custom xcodebuild arguments' setting for the XCode plugin.

This fix does not require the XCode GUI.


I encountered the same problem. Nicks solution does work, but is requiring additional dependencies. You don't need the heavy-handed npm xcode module for this. Just add a line to this file:$PROJECT_ROOT/platforms/ios/cordova/build.xcconfig

CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist

Note that before XCode 6.1.1, this needed to be specified as "$(SDKROOT)/ResourceRules.plist" (notice the quotes).

If you are running this inside automated build systems such as Jenkins and wont't/can't use any XCode GUI, just create a small Cordova hook, leveraging npm's fs.appendFile, at this location:$PROJECT_ROOT/hooks/before_build/ios_resourcerules.js (make sure it has chmod +x)

#! /usr/local/bin/nodevar fs = require("fs");fs.appendFileSync('build.xcconfig', '\nCODE_SIGN_RESOURCE_RULES_PATH =  $(SDKROOT)/ResourceRules.plist', function (err) { if (err) throw err;  console.log('CODE_SIGN_RESOURCE_RULES_PATH added to Cordova iOS build configuration.');});

This will might be merged in an upcoming Cordova release, so the hook will become unnecessary (i'm creating a see this PR for Cordova-iOS).

In case the above JavaScript snippet fails to execute due to a "wrong argument" failure, replace the file's content as follows:

#!/bin/bashif [ ! -f ./build.xcconfig ]; then  echo "[ERROR] hook befor_build/ios_resourcerules.sh cannot execute, ./build/xcconfig not found in $PWD"  exit 1fiecho '// (CB-7872) Solution for XCode 6.1 signing errors related to resource envelope format deprecation' >> ./build.xcconfigecho 'CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist' >> ./build.xcconfigecho 'CODE_SIGN_RESOURCE_RULES_PATH added to Cordova iOS build configuration.'


If you want to get really crazy, you can directly update PackageApplication.

# In /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplicationmy @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",                     "--sign", $opt{sign},                     "--resource-rules=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ResourceRules.plist");# OLD:               "--resource-rules=$destApp/ResourceRules.plist");

I was already hacking this script to accept a keychain arg, so it made sense for me. Note I'm not using the Xcode Jenkins plugin -- I'm using Jenkins but running all the build commands from a script.