Xcode 4.5 和 Phonegap 2.0 参考问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12532295/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 4.5 and Phonegap 2.0 reference issue
提问by AlexC
Yesterday I updated new Xcode 4.5, and I got an error in my build and I am not sure how can I even fix this.
昨天我更新了新的 Xcode 4.5,我的构建出错了,我不知道如何解决这个问题。
Everything works fine if I build in simulator, but when I try to build for Archive for example, i get this:
如果我在模拟器中构建一切正常,但是当我尝试为存档构建时,我得到这个:
ld: warning: ignoring file /Users/corotchi/Library/Developer/Xcode/DerivedData/NJR_IR-ftjwhrqtxwedihfjrbjikbqqttkx/Build/Products/Release-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (armv7s): /Users/corotchi/Library/Developer/Xcode/DerivedData/NJR_IR-ftjwhrqtxwedihfjrbjikbqqttkx/Build/Products/Release-iphoneos/libCordova.a
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_CDVURLProtocol", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and more errors bellow, which are the same
以及更多的错误,它们是相同的
Everything worked fine until u updated the Xcode, I had another issue before where I read the formums that I have to remove the "ARMV6" from the build settings, cause it is not supported anymore in new IOS, and after that I get this reference issue.
一切正常,直到您更新 Xcode,在我阅读必须从构建设置中删除“ ARMV6”的表格之前,我遇到了另一个问题,因为新 IOS 不再支持它,之后我得到了这个参考问题。
I appreciate any help, THanks!!!!
我感谢任何帮助,谢谢!!!!
回答by Moin Uddin
Remove armv7s from Valid Architectures from both your project and Cordova(phonegap) project. Also set iOS Deployment target 4.3 or above in both project and Cordova(phonegap) project. After that Clean and Clean Build Folder. This will solve the problem.
从您的项目和 Cordova(phonegap) 项目的有效架构中删除 armv7s。同时在项目和 Cordova(phonegap) 项目中设置 iOS 部署目标 4.3 或更高版本。之后清理和清理构建文件夹。这将解决问题。
回答by scotsqueakscoot
If you also take out armv7s from the build settings, you should get it to build for you.
如果您还从构建设置中取出 armv7s,您应该让它为您构建。
Edit: As per below: Fix can be found here via PhoneGap: https://issues.apache.org/jira/browse/CB-1360
编辑:如下所示:可以通过PhoneGap在此处找到修复程序:https: //issues.apache.org/jira/browse/CB-1360
回答by seufagner
This is a bug already fixed at Cordova 2.2.0
这是 Cordova 2.2.0 已修复的错误
回答by smartkid
Change the Buid setting ---> Architecture ---> Build Active Architectureonly ---> YesThis solved my issue for using old cordova versions in new Xcode 5
更改Buid 设置 ---> Architecture ---> Build Active Architectureonly ---> Yes这解决了我在新 Xcode 5 中使用旧的cordova 版本的问题