We are having the same issue found here, here, here and here
Basically we upgraded to xcode 6.1 and our build are getting the "ResourceRules.plist: cannot read resources" error.
We have a Jenkins server that does our ios builds for us. We are using the Xcode plugin on Jenkins to do the actual build and signing. Any thoughts on how we can make this change without manually opening xcode and doing this solution found on the other answers:
Click on your project > Targets > Select your target > Build Settings >
Code Signing Resource Rules Path
and add :
$(SDKROOT)/ResourceRules.plist
I'm very new to Xcode and iOS build in general. I have found the project.pbxproj file inside the Unity-iPhone.xcodeproj file. It looks like this contains the build settings under the /* Begin XCBuildConfiguration section */ section it lists what looks like similar build properties foundin Xcode, however I do not see anything like "Code Signing Resource Rules Path".
Does anyone have experience manually editing this file? Is that a bad idea in general?
Thanks
After the new release of XCode 7 on 23rd Sept 2015, Apple started rejecting any application that is using
CODE_SIGN_RESOURCE_RULES_PATH
, making the Jenkins build automatically rejected. However, settingCODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist
into the Custom xcodebuild arguments causes a build failure.This answer resolved the issue: https://stackoverflow.com/a/32762413/5373468
This is clearly a bug that Apple forgot to fix a while ago, as this article is also highlighting: http://cutting.io/posts/packaging-ios-apps-from-the-command-line/
I had EXACTLY the same problem, as you have. We are building our iOS app on Jenkins, so we couldn't manually set "Code Signing Resource Rules Path".
I have wrote a small NodeJS file which does the job for me (see the code below).
The script use a nice NodeJS package called xcode which helps me with the parsing of the xcode.xcodeproj file.
I don't know if you are using Cordova/Phonegap or what you are using, but if you are can just copy the code and make a Cordova hook. If not I'm sure you can execute the file from Jenkins, with some small changes.
Anyways, I hope this script will help you:
If you want to get really crazy, you can directly update PackageApplication.
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.
If you're using Jenkins with the XCode plugin, you can modify the
'Code Signing Resource Rules Path'
variable by adding: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
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)
This will
mightbe merged in an upcoming Cordova release, so the hook will become unnecessary (i'm creating asee 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:
We are using Unity + Jenkins for auto builds.
You can achieve with post process cs scripts; however; for quick (and dirty fix) you can apply following bash command after Unity but before xcode: