Yesterday (3/10/14) when iOS 7.1 was released I also upgraded to Xcode 5.1 and found that my PhoneGap/Cordova project would no longer compile to my iPhone 5s. I also upgraded Cordova to the most recent release: v 3.4.0-0.1.3.
I have read many different solutions on SO that relate so changing active architectures and building only active architectures, and none of them work. So here's what I've tried and the errors I get. Initially I got the error:
missing required architecture arm64 in file <long file path omitted> libCordova.a
Undefined symbols for architecture arm64
So I tried the following. I selected the CordovaLib sub-project in my project, and in both the project and target, I went to Build Settings under Architectures and made sure that arm64
was not included in any of the Debug or Release architectures. At this time Build Active Architecture Only is set to "Yes". That resulted in the following error:
file was built for archive which is not the architecture being linked (armv7):
<long file path omitted> libCordova.a
Undefined symbols for architecture armv7
Setting Build Active Architecture Only to "No", the error again becomes:
missing required architecture arm64 in file <long file path omitted> libCordova.a
Undefined symbols for architecture arm64
I'm not sure what else to try. The project's architecture settings only includes the key "Base SDK" which is set to iOS 7.1. The project's target does not have architectures settings. Anyway I'm fairly certain the problem lies with the embedded CordovaLib sub-project. What can I do to make this thing compile to my device successfully?
Update: same issue on Apache's Jira: https://issues.apache.org/jira/browse/CB-6223
@Shazron posted the fix on the Apache JIRA - he notes that the fix will be released as part of Cordova 3.5:
Here's a link to Shazron's complete writeup of this problem: http://shazronatadobe.wordpress.com/2014/03/12/xcode-5-1-and-cordova-ios/
It is now released and the short version of what to do is:
Cordova CLI 3.4.1-0.1.0 is out, which includes Cordova iOS 3.4.1 which incorporates all the fixes mentioned in this blog post. Update your Cordova CLI, and if you have an existing project, do a “cordova platform update ios“.
Another approach that works:
Downgrade Xcode 5.1 to 5.0.2 worked for me, I could not wait for an official Cordova 3.5 release with the fix.
You can get a copy of the previous version here: https://developer.apple.com/downloads/index.action
They just released a new version 3.4.1 that address this issues.
Therefore I update a single file to point to the TAG 3.4.1:
/usr/local/lib/node_modules/cordova/platforms.js
line 24 from:
version: '3.4.0'
to:
version: '3.4.1'
Then you remove the iOS folder in your project and run:
cordova platform add ios
This will download the new template based on 3.4.1 with all the patches.
Follow the instructions on this video: https://www.youtube.com/watch?v=EIkJAKcz8DE
Just add arm64 in your projects valid architectures and remove all the conditional architecture of Cordova's project.
I was able to get my app to build in XCode 5.1 by first building the CordovaLib project separately from within XCode and then building my project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With