簡體   English   中英

為什么我的項目不能在iPhone Simulator中運行?

[英]Why won't my project run in the iPhone Simulator?

出於某種原因,我的應用程序將在設備上安裝並正常運行,但是當我嘗試在iPhone Simulator上安裝應用程序時,出現以下警告:

ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit, missing required architecture i386 in file


ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/Foundation.framework/Foundation, missing required architecture i386 in file


ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics, missing required architecture i386 in file


ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/CFNetwork.framework/CFNetwork, missing required architecture i386 in file


ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox, missing required architecture i386 in file


ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices, missing required architecture i386 in file


ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file


ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore, missing required architecture i386 in file

這會導致一堆錯誤,而這些錯誤只是在不存在這些框架時發生的。 錯誤如:

  "_OBJC_CLASS_$_NSMutableCharacterSet", referenced from:      objc-class-ref-to-NSMutableCharacterSet in SBJsonWriter.o

我有同樣的問題。 這是由於在啟用“復制”選項的情況下將框架從一個項目拖到另一個項目。 即使我后來取消引用了這些框架並正確添加了它們,它仍然給了我這些錯誤,直到我從項目中刪除了框架目錄。

答案是:

1)基本SDK應該是Device

2)iPhone SDK框架已復制到您的項目目錄(在磁盤上)。 打開您的項目目錄,然后刪除所有標准的iPhone SDK框架。

3)清理緩存並重建

它正在嘗試針對要在模擬器上使用的設備庫進行構建。 路徑應類似於:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit

...使用iPhoneSimulator.platform而不是iPhoneOS.platform 檢查您的構建設置,清理項目並清空Xcode緩存(Xcode> Empty Cache ...)。

如果我沒記錯的話,如果您使用基本SDK> 3.2,則應將架構設置為優化。 這是armv7。 我不確定。
〜納塔納夫拉。

我認為您將iPhone Device xx(而不是iPhone Simulator xx)設置為基本SDK。 當我這樣做時,類似的事情發生在我身上。

我想出一個解決辦法。 我基本SDK設置為iPhone模擬器4.0,因為它仍然試圖從獲得的iPhoneOS的SDK,我改名iPhoneOS.platoformiPhoneOS_2.platform這樣的Xcode不能從平台訪問軟件開發工具包。

您需要建立在頂部菜單欄上,然后按清除所有目標的選項

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM