构建到64位时,phonegap cordova xcode链接失败

时间:2014-02-26 15:28:07

标签: ios xcode cordova

我在xcode 5.0.2中有一个cordova项目,它在iphone5c上完美运行但在iphone5s上没有用 我读了一些关于此问题并认为问题是我必须在64位架构上构建我的项目 我做这个构建设置:
架构 - 标准架构(包括64位)(armv7,armv7s,arm64)
仅构建活动架构 - 否

当我构建时,我得到了这个错误:

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)

任何人都知道该怎么做? 非常感谢。

2 个答案:

答案 0 :(得分:3)

问题似乎是你的libCordova版本没有为arm64编译。

快速解决方法是从构建体系结构列表中删除arm64 - 5s将很乐意运行为armv7编译的代码。

正确的解决方法是将Cordova升级到具有arm64版本的库的版本。

答案 1 :(得分:3)

问题在于Xcode 5.1支持64位。

创建的cordova项目包含cordova库(项目导航器窗格中的“CordovaLib.xcodeproj”项目),该项目未针对arm64进行配置。

要解决此问题,请单击“CordovaLib.xcodeproj”,其中显示项目设置转到“架构”和表格,并将所有架构更改为“$(ARCHS_STANDARD)”或标准架构。 (它们最初设置为不同的值,这是构建失败的原因)