简体   繁体   English

Xcode 4.4 - 无法运行项目

[英]Xcode 4.4 - Unable to run project

Having just upgraded Xcode 4.3 to Xcode 4.4, I get the following errors when running an existing project: 刚刚将Xcode 4.3升级到Xcode 4.4,运行现有项目时出现以下错误:

On the simulator: "Cannot run on the selected destination. The selected destination does not support the architecture for which the selected software is built. Switch to a destination that supports that architecture in order to run the selected software." 在模拟器上:“无法在所选目标上运行。所选目标不支持为其构建所选软件的体系结构。切换到支持该体系结构的目标,以便运行所选软件。”

On the device: "Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device." 在设备上:“Xcode无法使用所选设备运行。请选择具有支持的体系结构的目标,以便在此设备上运行。”

The funny this is, the project ran on Xcode 4.4 and the simulator for the first couple of runs and then stopped working. 有趣的是,该项目在Xcode 4.4和最初几次运行的模拟器上运行,然后停止工作。 Have tried restarting but not reinstalling just yet, as Xcode is quite a big application and if it's just a settings problem then I don't really want to download it again from scratch. 尝试重新启动但尚未重新安装,因为Xcode是一个非常大的应用程序,如果它只是一个设置问题,那么我真的不想再从头开始下载它。

Notes : Base SDK is Latest iOS (iOS 5.1), I'm on Lion (not Mountain Lion just yet) and my Deployment Target is iOS 4.0. 注意 :基础SDK是最新的iOS(iOS 5.1),我是Lion(不是Mountain Lion),我的部署目标是iOS 4.0。

I had this problem and it turned out to be a spelling mistake in the product name in the build settings. 我遇到了这个问题,结果是构建设置中的产品名称出现了拼写错误。 Check all you product references are consistent in the settings and plists. 检查所有产品参考在设置和plist中是否一致。 Also check the product name does not contain a space or other "illegal" characters; 还要检查产品名称是否包含空格或其他“非法”字符; this also causes the same error 这也会导致同样的错误

I had this problem as well upgrading to 4.5 and my iPhone 4 to IOS 6 我有这个问题,升级到4.5和我的iPhone 4到IOS 6

"Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device." “Xcode无法使用所选设备运行。请选择具有支持的体系结构的目标,以便在此设备上运行。”

As I already ran on Mountain Lion, I did the following 由于我已经在山狮上跑了,我做了以下几点

1) set the valid architectures to the armv7s & armv7 1)将有效架构设置为armv7s和armv7

2) doublechecked the spelling of the product name 2)双重检查产品名称的拼写

3) reinstall to xcode 4.1.1 3)重新安装到xcode 4.1.1

It worked for a while, but then I got the same error again. 它工作了一段时间,但后来又出现了同样的错误。 Then I got the tip (so obvious) to 然后我得到了提示(如此明显)

4) delete the previously installed app (for debugging) on my device. 4)删除我设备上以前安装的应用程序(用于调试)。

this worked! 这工作了! I will now never forget to delete the app as well on my device just to be sure it gets built with the latest settings. 我现在永远不会忘记在我的设备上删除该应用程序,以确保它使用最新设置构建。

Update: I have retried with xcode 4.5 / ios6 and above steps do work now as well. 更新:我已经尝试使用xcode 4.5 / ios6以及上面的步骤。 So I can now work with xcode 4.5 and ios 6. 所以我现在可以使用xcode 4.5和ios 6。

I upgrade Xcode from 4.3.2 to 4.5 this weekend and got the same issue. 我本周末将Xcode从4.3.2升级到4.5,并遇到了同样的问题。

in my case, 就我而言,

I fix it by changing project setting. 我通过改变项目设置来解决它。 Previously my project setting in Xcode 4.3.2 has an armv6 support in build - architecture. 以前我在Xcode 4.3.2中的项目设置在构建 - 体系结构中有一个armv6支持。 Since Xcode 4.5 drops this support, so I have to delete armv6 strings. 由于Xcode 4.5删除了这个支持,所以我必须删除armv6字符串。 That fix it, I can debug codes with iOS 6 device. 修复它,我可以使用iOS 6设备调试代码。

But when I submit the app, I have to go back to XCode 4.3.2. 但是当我提交应用程序时,我必须回到XCode 4.3.2。 because marketing team in my company won't want to loose those possible minority users, in China, there are still few 4.1 and 4.2.1 existing. 因为我公司的营销团队不想放弃那些可能的少数用户,在中国,现有的4.1和4.2.1仍然很少。

so if your project ever support armv6, and encounter this unable to run project due to architecture in XCode 4.5, please have a try like me. 因此,如果您的项目曾支持armv6,并且由于XCode 4.5中的体系结构而遇到无法运行的项目,请尝试像我一样。 hope can help. 希望能有所帮助。

Upgrading to Mountain Lion fixed the issue. 升级到Mountain Lion解决了这个问题。 Not sure why, but it is now working on the simulator and on the device. 不知道为什么,但它现在正在模拟器和设备上工作。

I experienced exactly the same problem after upgrading from Xcode 4.3 to 4.4. 从Xcode 4.3升级到4.4后,我遇到了完全相同的问题。 Only for 1 of my iOS projects, though. 但是,仅适用于我的一个iOS项目。 My solution was to create a new project and re-add all my source, dependencies (except KIF Integration Tests, which I haven't added yet) and other custom libs. 我的解决方案是创建一个新项目并重新添加我的所有源代码,依赖项(KIF集成测试除外,我还没有添加)和其他自定义库。 After doing so I was finally able to debug my app on my iPhone and iPod Touch. 在这样做后,我终于能够在我的iPhone和iPod Touch上调试我的应用程序了。

My setup is OSX Lion and Base SDK is Latest iOS (5.1). 我的设置是OSX Lion和Base SDK是最新的iOS(5.1)。

尝试在Library/Developer/XCode/DerivedData文件夹中删除应用程序的临时文件夹并重建。

The reason I want to add is all the above could not solve this problem: 我想添加的原因是以上所有都无法解决这个问题:

And my steps are: 我的步骤是:

  1. Uninstall ur app on the device 在设备上卸载你的应用程序

  2. check if the info.plist files are duplicated (which I mean there could be two same plist for the same Products) 检查info.plist文件是否重复(我的意思是相同的产品可能有两个相同的plist)

  3. Click on your project, check the "IOS Deployment Target" under the PROJECT and all "Deployment Target" under TARGETS are the same (most of the time, at this point, u could close xcode and restart, maybe it will work after this step) 点击你的项目,检查PROJECT下的“IOS部署目标”,TARGETS下的所有“部署目标”是相同的(大多数时候,你可以关闭xcode并重新启动,也许它会在这一步之后工作)
  4. If it is still doesn't work, change you "Base SDK" from Latest iOS(iOS 6.0) to iOS 6.0(under your "Build Settings") for your PROJECT and TARGETS (quit xcode, cmd-q, or force quit, and restart again) 如果它仍然不起作用,请将您的“Base SDK”从最新iOS(iOS 6.0)更改为iOS 6.0(在“构建设置”下),用于PROJECT和TARGETS(退出xcode,cmd-q或强制退出,并重新启动)
  5. after all those steps, it should work. 在所有这些步骤之后,它应该工作。 (if the above doesn't work, u could still copy out the project and recreate a new one, don't do it til u hv no choices) (如果上面的方法不起作用,你仍然可以复制出一个新的项目并重新创建一个新项目,直到你没有选择为止)

(PS: This is a really buggy problem, actually after I fixed it, and i changed everything back, it is still working.) (PS:这是一个非常错误的问题,实际上在我修复它之后,我改变了一切,它仍在工作。)

Forget at what I said above, I found the real quick way to solve this problem, force quit your Xcode, and restart it again, sometimes you will need to restart you device as well. 忘了我上面所说的,我找到了解决这个问题的真正快捷方法,强制退出你的Xcode,然后重新启动它,有时你也需要重启你的设备。 Good luck guys, really get sick of this kind of problem. 祝你好运,真的厌倦了这种问题。

I ran across this issue this evening after an update to OSX. 在OSX更新后,我今天晚上遇到了这个问题。 The project had been running fine previously. 该项目以前运行良好。 It turned out all that was necessary was a reboot. 事实证明,所有必要的都是重启。 Still scary though. 虽然仍然可怕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM