配置Xcode開發環境遇到的問題

來源:互聯網
上載者:User

配置Xcode開發環境遇到的問題

 

在虛擬機上安裝了新的mac系統,使用和舊機器相同的apple id,想要配一個於舊機器相同的開發環境。

於是升級了mac os x從10.7更新至10.7.4

然後下載了xcode 4.5安裝。(可以支援ios 6)

問題1:

到developer.apple.com下載development和distribution的certificates, 在Xcode

的organizer中refresh,可是在provisioning profiles的status顯示valid signing identity not found,而且在key chains中看“我的認證”裡面空白。“認證”裡面的證書沒有和建立的key綁定。

解決辦法:

在舊的系統中,打開key chians,找到開發和發佈用的key,逐個點右鍵,選輸出,然後將輸出的。p12檔案拷貝到新系統中,拖到key然後輸入密碼進行安裝。之後organizer會自動refresh就可以看到provisioning profile的status變為“valid profile”

問題2:

將之前的project拷貝到新系統中,打開clean,build,提示有一個error:

"libxml/tree.h" file not found.

解決方法:

project -> Edit Project Setting -> Build 在 Seatch Paths中的 Header Search Paths

將之前的 /usr/include/libxml2 改為 $(SDKROOT)/usr/include/libxml2

 

完整的配置方法如下:

 

Adding libxml2 is a big, fat, finicky pain in the ass. If you're going to do it do it before you get too far in building your project.

Here's how.

Target settings

Click on your target (not your project) and select "Build Phases". Click on the reveal triangle titled "Link Binary With Libraries". Click on the "+" to add a library. Scroll to the bottom of the list and select "libxml2.dylib". That adds the libxml2 library 2 your project… but wait.

Project settings

Now you have to tell your project where to look for it three more times.

Select the "Build Settings tab". Scroll down to the "Linking" section. Under your project's columns double click on the "Other Linker Flags" row. Click the "+" and add "-lxml2" to the list.

Still more.

In the same tab, scroll down to the "Search Paths" section. Under your project's column in the "Framework Search Paths" row add "/usr/lib/libxml2.dylib".

In the "Header Search Paths" AND the "User Header Search Paths" row add "$(SDKROOT)/usr/include/libxml2". In those last two cases make sure that path is entered in Debug AND Release.

Then. Under the "Product" Menu select "Clean".

Then, if I were you (and let's face it I probably am) I'd quit Xcode and walk away. When you come back and launch you should be good to go.

問題3:

在build程式時有如下的錯誤提示:

…….libPhoneGapLib.a, file was built for archive which is not the architecture being linked (armv7s)…….

開始查資料

http://stackoverflow.com/questions/5303933/xcode4-linking-problem-file-was-built-for-archive-which-is-not-the-architecture

中遇到類似的問題,解決辦法是I changed 'Build Active Architecture Only' of TapkuLibrary from Yes to No and it compiles with no problem.

我在project的Build Settings中看到,Build Active Architecture Only已經設定為no。

 

Xcode cannot run using the selected device.

Choose a destination with a supported architecture in order to run on this device.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.