Xcode “The selected destination does not support the architecture ” 錯誤

來源:互聯網
上載者:User

升級了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." 錯誤。

在網上搜尋半天找不到好的解決方式,即便是stackoverflow上。折騰了半天,最後換了關鍵詞搜尋,總算找到一個還算靠譜的解決方案,記下來希望能幫看到的哥們節省點時間。

文章地址在:http://hiediutley.com/2011/03/10/xcode4-is-your-old-project-hanging-in-the-simulator/

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
  1. In terminal – navigate to your project directory
  2. cd into the ${PROJECT_NAME}.xcodeproj directory
  3. run this command: find . -name ‘*yourUserName*’ 
  4. rm -rf any files or dirs that come up
  5. Reopen Xcode4 – build and *hopefully* run your project

簡單譯一譯:

如果你有同樣的問題,那麼刪除項目中所有的跟你的userid有關的檔案也許能讓你啟動它。

怎樣刪除使用者指定的專案檔呢?

1、在命令列中cd到你的工程檔案夾下

2、cd進xcode 項目的檔案夾,大致格式是:${PROJECT_NAME}.xcodeproj (註: 每一個xcode 項目其實是一個檔案夾。。你如果右鍵點擊專案檔會發現一個屬性叫:show package content,其實就是瀏覽它的內容。。)

3、執行這個命令:find . -name ‘*yourUserName*’  (註:把yourUserName替換成你的使用者名稱就行啦)

4、刪除列出的檔案。比如,我執行完find後出現如下檔案:

./project.xcworkspace/xcuserdata/kevin.xcuserdatad
./xcuserdata/kevin.xcuserdatad

於是我用rm -rf ./project.xcworkspace/xcuserdata/kevin.xcuserdatad 一個個把它們幹掉。

4、把xcode關掉(command+q徹底退出啊。。記得),然後重開。*希望*能運行吧。不行就只能再google了。。


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.