Xcode可以用模拟器编译,但不能用真实设备

Xcode可以用模拟器编译,但不能用真实设备,xcode,Xcode,我试图将我的应用程序加载到我的iPhone 5.0上,但我收到了15个错误,所有这些都与架构armv7缺少文件和未定义的符号有关。我有xcode 4.2.1,错误如下: > ld: warning: ignoring file > /Users/kylebeard/Xcode/Construction/Foundation.framework/Foundation, > missing required architecture armv7 in file Undefi

我试图将我的应用程序加载到我的iPhone 5.0上,但我收到了15个错误,所有这些都与架构armv7缺少文件和未定义的符号有关。我有xcode 4.2.1,错误如下:

> ld: warning: ignoring file    
> /Users/kylebeard/Xcode/Construction/Foundation.framework/Foundation,
> missing required architecture armv7 in file Undefined symbols for
> architecture armv7:   "_objc_msgSendSuper2", referenced from:
>       -[ViewController didReceiveMemoryWarning] in ViewController.o
>       -[ViewController viewDidLoad] in ViewController.o
>       -[ViewController viewDidUnload] in ViewController.o
>       -[ViewController viewWillAppear:] in ViewController.o
>       -[ViewController viewDidAppear:] in ViewController.o
>       -[ViewController viewWillDisappear:] in ViewController.o
>       -[ViewController viewDidDisappear:] in ViewController.o
>       ...   "_objc_setProperty", referenced from:
>       -[AppDelegate setWindow:] in AppDelegate.o
>       -[AppDelegate setViewController:] in AppDelegate.o   "__objc_empty_vtable", referenced from:
>       _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
>       _OBJC_CLASS_$_AppDelegate in AppDelegate.o
>       _OBJC_CLASS_$_ViewController in ViewController.o
>       _OBJC_METACLASS_$_ViewController in ViewController.o   "_objc_msgSend", referenced from:
>       _main in main.o
>          "_objc_msgSend_stret", referenced from:
>     "_objc_autoreleasePoolPop", referenced from:
>       _main in main.o   "__objc_empty_cache", referenced from:
>       _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
>       _OBJC_CLASS_$_AppDelegate in AppDelegate.o
>       _OBJC_CLASS_$_ViewController in ViewController.o
>       _OBJC_METACLASS_$_ViewController in ViewController.o   "_objc_storeStrong", referenced from:
>       -[AppDelegate .cxx_destruct] in AppDelegate.o
>       -[ViewController .cxx_destruct] in ViewController.o   "_objc_retain", referenced from:
>    
>      "___CFConstantStringClassReference", referenced from:
>      "_objc_autoreleasePoolPush", referenced from:
>       _main in main.o   "_NSStringFromClass", referenced from:
>       _main in main.o   "_objc_release", referenced from:
>       _main in main.o   "_objc_retainAutoreleasedReturnValue", referenced from:
>       
>       _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
>       _OBJC_METACLASS_$_ViewController in ViewController.o ld: symbol(s) not found for architecture armv7 clang: error: linker
> command failed with exit code 1 (use -v to see invocation)

正如您所说,错误是
缺少体系结构armv7
,因此请确保将
armv7
添加到Xcode中构建设置的体系结构部分,然后尝试重新编译。此外,请检查它是否在任何目标中都未被覆盖到
i386

添加了标准armv7(ARCHS_Standard_32位),并且i386不会在任何位置被覆盖。我还对目标和项目中的构建活动体系结构应用了yes。我还是会犯错误。您将只希望将Build Active Architecture设置为no。Im将它们切换回原处,没有任何更改。我在其他网站上读到过,如果你启动了一个项目,然后更新了xcode,它可能会导致问题。我从4.1开始,中途升级到4.2,所以可能有问题。我正在考虑创建一个新项目,并将我所有的代码复制到这个新项目中,以保持它的统一性。这会很有帮助,因为
armv6
armv7
的新Xcode构建上的默认构建设置(假设您创建了一个Cocoa Touch项目)。如果它仍然无法工作,那么您可能有一个损坏的
iOS SDK
,需要删除/重新下载Xcode。