解决Xcode "The selected destination does not support the architecture " 错误错误

来源:互联网 发布:ug编程几何体 编辑:程序博客网 时间:2024/05/16 11:06
XCODE编译运行项目后,发现工程编译后无法运行,出现:
"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." 错误。

首先,出现该问题一般是在
${PROJECT_NAME}.xcodeproj目录的相关文件的问题,像xcschemes/xcschememanagement.plist

If you are having the same problem — deleting all the Xcode4 project data with your userid may get you up and running again…
How to go about deleting the user-specific project data
In terminal – navigate to your project directory
cd into the ${PROJECT_NAME}.xcodeproj directory
run this command: find . -name ‘*yourUserName*’
rm -rf any files or dirs that come up
Reopen Xcode4 – build and *hopefully* run your project

解决方法步骤如下:

1、在命令行中cd到你的工程文件夹下

2、cd进xcode 项目的文件夹,大致格式是:${PROJECT_NAME}.xcodeproj (注: 每一个xcode 项目其实是一个文件夹。。你如果右键点击项目文件会发现一个属性叫:show package content,其实就是浏览它的内容。。)

3、进入yourname.xcuserdatad/xcschemes 后将xcschememanagement.plist 目录删除
rm -rf ./project.xcworkspace/xcuserdata/"用户名".xcuserdatadrm -rf ./xcuserdata/"用户名".xcuserdatad
rm -rf ./project.xcworkspace/xcuserdata/xcschemes/xcschememanagement.plist

4、把xcode关掉(command+q彻底退出啊。。记得),然后重开。*希望*能运行吧。不行就只能再google了。。


还有另一种可能原因是,出现有以下类似警告的错误提示,造成上述错误弹出窗口出现:

[WARN]Warning: Multiple build commands for output file /Developer/build/Release-iphonesimulator/

target引用了名字重复的资源

找到当前的target,展开之后,找到Copy Bundle Resources栏目,然后在里面找到重复名字的资源或本身没资源但此处确有文件的扩展名为.plist和png的文件一一移除,删除不要的那个即可

Command+Q退出重新打开工程项目即可



原创粉丝点击