Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phonegap cordova xcode link failed when build to 64bit

Tags:

xcode

ios

cordova

i have a cordova project in xcode 5.0.2 it works perfectly on a iphone5c but didnt work on iphone5s i read some on this and thought that the problem is i have to build my project on 64bit architecture.
i make this build settings:
architecture - standart architecture (including 64-bit)(armv7, armv7s, arm64)
build active architecture only - no

and when i build i get this errors:

ld: warning: ignoring file /Users/chana/Library/Developer/Xcode/DerivedData/Pitaron-    echagbyhunbeprbdfodckoblgtuq/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive  which is not the architecture being linked (x86_64):  /Users/chana/Library/Developer/Xcode/DerivedData/Pitaron-echagbyhunbeprbdfodckoblgtuq/Build/Products/Debug- iphonesimulator/libCordova.a
Undefined symbols for architecture x86_64:
  "_CDVLocalNotification", referenced from:
  -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
   "_CDVPluginHandleOpenURLNotification", referenced from:
  -[AppDelegate application:handleOpenURL:] in AppDelegate.o
  "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
  _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVCommandQueue", referenced from:
   _OBJC_CLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_CLASS_$_CDVViewController", referenced from:
  _OBJC_CLASS_$_MainViewController in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
  _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
  _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
  _OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

any body knows what to do?
thanks a lot.

like image 887
Chana Avatar asked Feb 26 '14 15:02

Chana


2 Answers

The problem is with Xcode 5.1 coming with 64 bit support.

The cordova project created contains cordova library (‘CordovaLib.xcodeproj’ project in the project navigator pane) which is not configured for arm64.

To resolve this issue, click on ‘CordovaLib.xcodeproj’ where it shows project settings goto ‘Architectures’ and table and change all architectures to ‘$(ARCHS_STANDARD)’ or Standard Architectures. (They have been initially set to different values which is the reason for build failing)

like image 172
Sasikant Avatar answered Nov 03 '22 08:11

Sasikant


The problem seems to be that your version of libCordova isn't compiled for arm64.

The quick fix is to remove arm64 from your list of build architectures - the 5s will happily run code compiled for armv7.

The proper fix is to upgrade Cordova to a version that has arm64 versions of the libraries compiled.

like image 33
iain_simpson Avatar answered Nov 03 '22 10:11

iain_simpson