Xcode 4.4 - 无法运行项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11673424/
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.4 - Unable to run project
提问by Jarada
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. 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 4.4 和模拟器上运行前几次运行,然后停止工作。已尝试重新启动但尚未重新安装,因为 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。
采纳答案by Jarada
Upgrading to Mountain Lion fixed the issue. Not sure why, but it is now working on the simulator and on the device.
升级到 Mountain Lion 解决了这个问题。不知道为什么,但它现在可以在模拟器和设备上运行。
回答by Martin Lockett
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. Also check the product name does not contain a space or other "illegal" characters; this also causes the same error
我遇到了这个问题,结果证明是构建设置中产品名称的拼写错误。检查您的所有产品参考在设置和 plist 中是否一致。还要检查产品名称不包含空格或其他“非法”字符;这也会导致同样的错误
回答by morksinaanab
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
由于我已经在 Mountain Lion 上跑步,因此我执行了以下操作
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. So I can now work with xcode 4.5 and ios 6.
更新:我已经重试了 xcode 4.5 / ios6 和以上步骤现在也可以工作。所以我现在可以使用 xcode 4.5 和 ios 6。
回答by LetBulletFlies
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. Since Xcode 4.5 drops this support, so I have to delete armv6 strings. That fix it, I can debug codes with iOS 6 device.
我通过更改项目设置来修复它。以前我在 Xcode 4.3.2 中的项目设置在构建架构中具有 armv6 支持。由于 Xcode 4.5 放弃了这种支持,所以我必须删除 armv6 字符串。修复它,我可以使用 iOS 6 设备调试代码。
But when I submit the app, I have to go back to 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.
但是当我提交应用程序时,我必须回到 XCode 4.3.2。因为我公司的营销团队不想失去那些可能的少数用户,在 CN ,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. hope can help.
因此,如果您的项目曾经支持 armv6,并且遇到由于 XCode 4.5 中的架构而无法运行项目的情况,请像我一样尝试。希望能帮上忙。
回答by Neil Millstone
Try deleting the temporary folder for the app in your Library/Developer/XCode/DerivedData
folder and rebuilding.
尝试删除文件夹中应用程序的临时文件Library/Developer/XCode/DerivedData
夹并重建。
回答by Gogorush
The reason I want to add is all the above could not solve this problem:
我想补充的原因是以上都不能解决这个问题:
And my steps are:
我的步骤是:
Uninstall ur app on the device
check if the info.plist files are duplicated (which I mean there could be two same plist for the same Products)
- 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)
- 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)
- 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)
在设备上卸载您的应用
检查 info.plist 文件是否重复(我的意思是同一产品可能有两个相同的 plist)
- 点击你的项目,勾选PROJECT下的“IOS Deployment Target”,TARGETS下的所有“Deployment Target”都是一样的(大多数时候,此时你可以关闭xcode并重新启动,也许这一步之后就可以了)
- 如果它仍然不起作用,请将您的“基本 SDK”从最新的 iOS(iOS 6.0)更改为 iOS 6.0(在您的“构建设置”下)为您的项目和目标(退出 xcode、cmd-q 或强制退出,并重新启动)
- 在所有这些步骤之后,它应该可以工作。(如果上述方法不起作用,您仍然可以复制项目并重新创建一个新项目,除非您别无选择,否则不要这样做)
(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. Good luck guys, really get sick of this kind of problem.
忘记我上面所说的,我找到了解决这个问题的真正快捷的方法,强制退出您的 Xcode,然后重新启动它,有时您还需要重新启动您的设备。祝你们好运,真的被这种问题烦死了。
回答by gronnbeck
I experienced exactly the same problem after upgrading from Xcode 4.3 to 4.4. Only for 1 of my iOS projects, though. 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. After doing so I was finally able to debug my app on my iPhone and iPod Touch.
从 Xcode 4.3 升级到 4.4 后,我遇到了完全相同的问题。不过,仅适用于我的 1 个 iOS 项目。我的解决方案是创建一个新项目并重新添加我的所有源代码、依赖项(KIF 集成测试除外,我尚未添加)和其他自定义库。这样做之后,我终于能够在我的 iPhone 和 iPod Touch 上调试我的应用程序。
My setup is OSX Lion and Base SDK is Latest iOS (5.1).
我的设置是 OSX Lion,基本 SDK 是最新的 iOS (5.1)。
回答by T. Markle
I ran across this issue this evening after an update to OSX. The project had been running fine previously. It turned out all that was necessary was a reboot. Still scary though.
在更新到 OSX 后,我今晚遇到了这个问题。该项目之前一直运行良好。事实证明,所需要的只是重新启动。不过还是挺吓人的。