2014-02-26 25 views
11

我在xcode 5.0.2中有一个cordova项目,它在iphone5c上完美工作,但没有在iphone5上工作 我读了一些,认为问题是我必须构建我的项目在64位体系结构上。
我做这个版本的设置:
架构 - 非标准架构(包括64位)只(ARMv7的,armv7s,arm64)
构建有源体系 - 没有phonegap当编译为64bit时,cordova xcode链接失败

,当我建立我得到这个错误:

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) 

任何机构都知道该怎么办?
非常感谢。

+0

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

回答

3

问题在于Xcode 5.1支持64位。

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

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

3

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

快速修复是从构建体系结构列表中删除arm64 - 5将很高兴地运行为armv7编译的代码。

正确的修复方法是将Cordova升级到已编译库的arm64版本的版本。