Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple Mach-O Linker Error on XCode 6.0.1

I have updated my XCode to 6.0.1 Before this update, I was able to build my project in both simulator and in my device. But now, it is giving me Apple Mach-O Linker Error

I surfed a lot. I have deleted the DerivedData folder. Still having the Problem.

I am building a Phonegap App. Please help me.

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CDVWebViewDelegate", referenced from:
      objc-class-ref in CDVInAppBrowser.o
  "_OBJC_CLASS_$_CDVInvokedUrlCommand", referenced from:
      objc-class-ref in CDVContacts.o
      objc-class-ref in CDVFile.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
  "_OBJC_CLASS_$_CDVPlugin", referenced from:
      _OBJC_CLASS_$_CDVLogger in CDVLogger.o
      _OBJC_CLASS_$_CDVContacts in CDVContacts.o
      _OBJC_CLASS_$_CDVDevice in CDVDevice.o
      _OBJC_CLASS_$_CDVNotification in CDVNotification.o
      _OBJC_CLASS_$_CDVFile in CDVFile.o
      _OBJC_CLASS_$_CDVFileTransfer in CDVFileTransfer.o
      _OBJC_CLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
      ...
  "_OBJC_METACLASS_$_CDVPlugin", referenced from:
      _OBJC_METACLASS_$_CDVLogger in CDVLogger.o
      _OBJC_METACLASS_$_CDVContacts in CDVContacts.o
      _OBJC_METACLASS_$_CDVDevice in CDVDevice.o
      _OBJC_METACLASS_$_CDVNotification in CDVNotification.o
      _OBJC_METACLASS_$_CDVFile in CDVFile.o
      _OBJC_METACLASS_$_CDVFileTransfer in CDVFileTransfer.o
      _OBJC_METACLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
      ...
  "_OBJC_CLASS_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.o
      objc-class-ref in CDVDevice.o
      objc-class-ref in CDVFile.o
  "_CDVLocalNotification", referenced from:
      -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
  "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVPluginResult", referenced from:
      objc-class-ref in CDVContacts.o
      objc-class-ref in CDVDevice.o
      objc-class-ref in CDVNotification.o
      objc-class-ref in CDVFile.o
      objc-class-ref in CDVLocalFilesystem.o
      objc-class-ref in CDVAssetLibraryFilesystem.o
      objc-class-ref in CDVFileTransfer.o
      ...
  "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVUserAgentUtil", referenced from:
      objc-class-ref in CDVInAppBrowser.o
  "_OBJC_CLASS_$_CDVCommandQueue", referenced from:
      _OBJC_CLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
      _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
  "_CDVPluginHandleOpenURLNotification", referenced from:
      -[AppDelegate application:handleOpenURL:] in AppDelegate.o
      -[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
like image 347
Prabakaran Raja Avatar asked Sep 25 '14 10:09

Prabakaran Raja


2 Answers

This kind of problems generally occur while updating your Xcode but any third party tool you are using may not be updated with this architecture armv64.

So Click on your Project Navigator from XCode.

Click On Targets from your Project and click on BuildSettings from it.

Find Valid Architectures in it.

Just double click on that and remove armv64 from that.

Make sure there is armv7 and armv7s only.

If this does not work then try to remove armv7s also.

Please check all your frameworks are linked properly and referenced. Try to remove and add again the frameworks for that third party tool.

Please check all the frameworks are properly referenced.

In my case this worked for me.

Clean and build your project. It should work fine now.

Hope it helps you.

like image 72
Manthan Avatar answered Oct 27 '22 00:10

Manthan


I found the solution, isn't a monkey patch, its a correction of the project. What we need to do its to change the architectures supported by the application:

  1. Go to Project -> Build Settings (check to see "all") -> Architectures -> Standard architectures (armv7 armv7s arm64)
  2. Go to Cordoba lib project -> Build Settings (check to see "all") -> Architectures:
    • Open the Debug tree and remove all elements inside them
    • Open the Release tree and do the same
  3. Go to Cordoba lib project (select target this time) and do the same of the step 2

See the youtube video for detailed information.

like image 22
norman784 Avatar answered Oct 27 '22 01:10

norman784