-
-
Save tigerbears/9480433 to your computer and use it in GitHub Desktop.
Like many of us, my company's iOS project: | |
- Has dependencies preventing arm64 support | |
- Uses Cocoapods | |
- Relies upon CI | |
- Would love to be built with the new Xcode (and LLVM) 5.1 hotness | |
Since Xcode 5.1's standard supported architectures now includes arm64, we needed to remove that architecture in a way that would persist across clean installs of our pods during our Jenkins CI server's workflow. This is my first time working with Cocoapods, so I had to do some digging to tie up the loose ends. | |
The first step is simple enough: | |
- In your main app project's build settings, change the Architectures value to "Other...". Add "armv7s armv7", and delete "$(ARCHS_STANDARD)". | |
Without Cocoapods, you'd be done, but each pod's project also needs to be configured in the same way or you're hosed. It'd be easy to manually make the change in a pod subproject or two, but these little elves are generated from scratch with each CI build. Even if recurring manual changes weren't wasteful and fraught with peril, this'll need to be automated. | |
Cocoapods lets you write a post-install hook that'll take care of this. It's documented at http://guides.cocoapods.org/syntax/podfile.html#post_install - though I first saw a reference to it in rjyo's answer at http://stackoverflow.com/questions/18881986/integration-error-with-cocoapods-and-xcode5 , so, thanks! | |
Add the following to the end of your Podfile: | |
post_install do |installer| | |
installer.project.targets.each do |target| | |
target.build_configurations.each do |config| | |
config.build_settings['ARCHS'] = "armv7s armv7" | |
end | |
end | |
end | |
Don't forget to run 'pod update' from your project root to pick up these changes and rebuild your workspace, and you should be good to go! |
I'm still having problems with this. My errors after following these instructions exactly.
ld: warning: directory not found for option '-L/Users/kevingibbon/Dropbox/Shyp/shyp_iphone/Shyp/Shyp/CardIO'
ld: warning: directory not found for option '-F"/Applications/Xcode.app/Contents/Developer/Library/Frameworks"'
Undefined symbols for architecture armv7s:
"OBJC_CLASS$_Stripe", referenced from:
objc-class-ref in SHCreditCardSelectorViewController.o
"OBJC_CLASS$_STPCard", referenced from:
objc-class-ref in SHCreditCardSelectorViewController.o
"OBJC_CLASS$_SSKeychain", referenced from:
objc-class-ref in SHUser.o
"OBJC_CLASS$_Mixpanel", referenced from:
objc-class-ref in SHPromotionViewController.o
objc-class-ref in SHAnalyticsUtility.o
objc-class-ref in SHLoginViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Instead of "armv7s armv7", you can use "$(ARCHS_STANDARD_32_BIT)". See http://cameronspickert.com/2014/01/20/remove-the-arm64-architecture-from-cocoapods-targets