【问题标题】:phonegap cordova xcode link failed when build to 64bit构建到 64 位时 phonegap cordova xcode 链接失败
【发布时间】:2014-02-26 15:28:07
【问题描述】:

我在 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)

有人知道该怎么做吗?
非常感谢。

【问题讨论】:

  • 我认为这个错误与模拟器中的 libCordova.a 有关。尝试为 iphone5s 构建并在设备中运行。

标签: ios xcode cordova


【解决方案1】:

问题在于 Xcode 5.1 支持 64 位。

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

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

【讨论】:

    【解决方案2】:

    问题似乎是您的 libCordova 版本未针对 arm64 编译。

    快速解决方法是从您的构建架构列表中删除 arm64 - 5s 将愉快地运行为 armv7 编译的代码。

    正确的解决方法是将 Cordova 升级到编译了 arm64 版本的库的版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多