2010年7月25日 星期日

base SDK missing and code sign error

Apple 最近剛推出iOS 4,大多數的程式開發者也紛紛把自已的SDK和XCODE昇級。不過我想有很多人會發現,一些以前舊的sample code或本來跑的好好的程式現在連compile都不會過。

Apple just released new iOS 4, and many programers upgraded their SDK and XCODE to the newer verison. After upgrading many of programers will notice that some programs can not be built due to "base SDK missing" in compile phase.

就拿SpeakHere這個sample code為例子,你可以在Xcode Help Document中發現它(既然它已經被放在說明文件中,為什麼阿婆公司不把它搞定而要我們這些使用者來處理這些鳥事呢?)

Take the sample code, SpeakHere, as an example. You can check it out in the help document of your xcode (Since the sample code already putting in the document of latest xcode Why doesn't Apple make some modification to allow it can be used more smoothly?)



點選"open project in xcode"你就會在左上角看到base SDK missing
click "open project in xcode" you will see "base SDK missing" in left top area.



這時候,請到這個Project的Configuration中改變Base SDK的setting, 把它改成iPhone Device 4.0.
Change the "Base SDK" setting to iPhone Device 4.0.



不過有時候你會發現,開始compile之後又會有別的Error出現,叫作Code Sign error,在網路上找到的解法有好幾種,大部份的人說把keychain access中的login設成default就可以解決這個問題,不過我不知道為什麼,在我的keychain access中我找不到設login為default的地方,所以我用了另外一個方法。
But while compiling this project, you will encounter another problem called "Code Sign error". There are several solutions on the internet that you can find. Most of the people said that can be corrected by setting "login" as default in keychain access utility. But unfortunatelly I can't find out where can I turn it on. So here is an alternative solution.



離開xcode之後,到這個project的目錄,尋找一個叫作project.pbxproj的檔案,通常它會在一個叫作{projectName}.xcodeproj的目錄下,把裡面的PROVISIONING_PROFILE移除掉,然後再重新啟動xcode,這時就可以發現又可以build了。

Exit XCODE and go to the project diectory. Find this file project.pbxproj in your {project path}/{projectName}.xcodeproj, and remove this line PROVISIONING_PROFILE in that file. Then open your xcode and rebuild it again.

至於這個PROVISIONING_PROFILE是什麼,老實說我也不知道,這個方法我也是從網路上找來的,
但是是從那裡找來的,我也忘記了,只能在這裡感謝這位分享出來的好人…

What is PROVISIONING_PROFILE? Frankly speeking, I don't know. I got the solution from the google search, but I forgot where is it came from. So I just can say "thank you Anonymous" here.

沒有留言: