重复目标:Xcode 无法使用选定的目标运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12724786/
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
Duplicated target: Xcode cannot run using the selected destination
提问by RickJansen
(OS X, not iOS): "Choose a destination with a supported architecture in order to run on this system"
(OS X,而不是 iOS):“选择具有受支持架构的目标以便在此系统上运行”
Fixed the copied .plist in the Build settings, removed spaces from the new product name. Can't find any difference with the original target's settings, still this dreaded error. Any ideas?
修复了构建设置中复制的 .plist,删除了新产品名称中的空格。找不到与原始目标设置的任何区别,仍然是这个可怕的错误。有任何想法吗?
采纳答案by RickJansen
With Xcode 4.5.2. (4G2008a) this issue has gone away, apparently. I can now make a duplicate of the original target, fix the product name, and get a properly running application.
使用 Xcode 4.5.2。(4G2008a) 这个问题显然已经消失了。我现在可以复制原始目标,修复产品名称,并获得一个正常运行的应用程序。
回答by DavidPhillipOster
I got this error when I opened an old project under Xcode 4.5. The problem: The build setting were set to Standard Architecture, which means 64bit and 32 bit, while the minimum deployment target was set to OS X 10.4.
在 Xcode 4.5 下打开旧项目时出现此错误。问题:构建设置设置为标准架构,即 64 位和 32 位,而最低部署目标设置为 OS X 10.4。
Setting the minimum deployment targetto OS X 10.5fixes the problem.
将最小部署目标设置为 OS X 10.5可解决此问题。
回答by user2004966
When i faced this issue, on top of the xcode window i changed My Mac 64-bit to My Mac 32-bit. It worked for me.
当我遇到这个问题时,在 xcode 窗口的顶部,我将我的 Mac 64 位更改为我的 Mac 32 位。它对我有用。
回答by onekiloparsec
For me it was a mismatch between the filename of the executable, as specified by "Product Name" in the target build settings, and the executable filename indicated in the Info.plist. In fact, when you duplicate a target, you get a "copy" suffix that you usually change right away, and this may lead to some mistakes.
对我来说,这是由目标构建设置中的“产品名称”指定的可执行文件名与 Info.plist 中指示的可执行文件名之间的不匹配。事实上,当你复制一个目标时,你会得到一个“复制”后缀,你通常会立即更改它,这可能会导致一些错误。
An additional indication of this mismatch can be seen when selecting the product app in Xcode, and opening it in the Finder. If the app icon is overlayed with a kind of "stop" sign, here it is, your app isn't executable.
在 Xcode 中选择产品应用程序并在 Finder 中打开它时,可以看到这种不匹配的附加指示。如果应用程序图标上覆盖有一种“停止”标志,则说明您的应用程序不可执行。
回答by Nitin Bhatt
If everything looks alright, one last thing that you should check contents of your app. Most probably application name Info.plist file does not match what you have in your build configuration.
如果一切正常,最后一件事就是检查应用程序的内容。很可能应用程序名称 Info.plist 文件与您在构建配置中的内容不匹配。
回答by Dave Higgins
I started getting the same thing. I did a Clean and it seems to have fixed it. Lion/Xcode 4.6.2
我开始得到同样的东西。我做了一个清洁,它似乎已经修复了它。狮子/Xcode 4.6.2
回答by EddyBrown
I got the same error message after accidentally copying a binary to /usr/local/bin. The binary was "manually" generated by Makefile - the building process of Xcode (5.1) was configured to place the binary in /usr/local/bin too. Removing the manually generated file and starting the build again fixed the problem.
不小心将二进制文件复制到 /usr/local/bin 后,我收到了相同的错误消息。二进制文件是由 Makefile “手动”生成的——Xcode (5.1) 的构建过程被配置为将二进制文件也放在 /usr/local/bin 中。删除手动生成的文件并再次启动构建解决了问题。