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

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/"用户名".xcuserdatad
rm -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退出重新打开工程项目即可



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值