苹果Mach-O链接器错误在XCode 6.0.1

我已经更新了我的XCode到6.0.1在此更新之前,我能够在模拟器和我的设备中构build我的项目。 但现在,它给我的苹果Mach-O链接器错误

我冲浪了很多。 我已经删除了DerivedData文件夹。 仍然有问题。

我正在构buildPhonegap应用程序。 请帮帮我。

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) 

这种问题通常在更新Xcode时发生,但是您正在使用的任何第三方工具可能无法使用此架构armv64进行更新。

所以从XCode上点击你的Project Navigator。

从项目中点击Targets ,然后点击BuildSettings

在其中findValid Architectures

只需双击,并armv64删除armv64

确保只有armv7和armv7s

如果这不起作用,那么也尝试删除armv7s

请检查您的所有框架链接是否正确并引用。 尝试删除并重新添加该第三方工具的框架。

请检查所有框架是否正确引用。

在我的情况下这对我有效。

清理并build立您的项目。 现在应该可以正常工作了。

希望它可以帮助你。

我find了解决办法,不是一个猴子补丁,它是一个项目的修正。 我们需要做些什么来改变应用程序支持的体系结构:

  1. 转到项目 – >构build设置(检查看“所有”) – >体系结构 – >标准体系结构(armv7 armv7s arm64)
  2. cordovalib项目 – >build立设置(检查看到“所有”) – >体系结构
    • 打开debugging树,并删除其中的所有元素
    • 打开Release树并执行相同的操作
  3. cordovalib项目(这次select目标),并执行相同的步骤2

有关详细信息,请参阅youtubevideo 。

您可以像Manthan说的那样去掉64位支持,但是对于app store合规性( 从2015年2月1日开始 ),您确实需要它。 我会build议开始更新所有的框架等到支持64位的版本的过程。

从我所见过和经历过的,使用Cocoapods是最容易的路线,因为它很容易控制你的框架版本和更新以及降级到其他版本。 我会build议找出你当前版本的框架是什么,并从那里慢慢更新,直到你find一个支持64位的版本与你当前的版本一起工作。

我发现的另一个通常可以修复机器错误的方法如下:

  • 确保Target => Architectures => Build Active Architectures设置为NO。
  • 确保Target => Search Paths => Framework search paths ,并且Library search paths具有$(inherited)作为它们的第一个条目。

转换为64位可能是一项非常艰巨的任务,但从长远来看可能是值得的。

当我导入一些git项目时,我得到了同样的问题,终于find了改变发展目标的解决scheme。

进入项目 – >常规 – >开发信息并更改部署目标。

我卸载了整个XCode 6.我更新了我的Mac电话,并重新安装了一遍。 创build了一个新的phonegap项目。 将代码(www文件夹)复制到新项目中。 build立它。 而且它在XCode 6中工作正常。

对不起,延迟的答复