基于 PhoneGap 的 iOS 应用程序缺少基本 SDK
Posted
技术标签:
【中文标题】基于 PhoneGap 的 iOS 应用程序缺少基本 SDK【英文标题】:Base SDK missing for PhoneGap-based iOS application 【发布时间】:2011-11-30 09:02:24 【问题描述】:我已经为 ios 安装了 PhoneGap 库并创建了一个新项目,但是当我运行应用程序时,我收到了错误 Base SDK missing
。这是为什么呢?
编辑 1
应用 mAc 回复后出现 230 个错误,这些是一些错误:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:60:23 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:60:23: error: expected function body after function declarator
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:91 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:91: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256:86 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256:86: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258:114 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258:114: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:187:31 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:187:31: error: unknown type name 'UIApplicationState'
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190:4 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190:4: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191:28 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191:28: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202:45 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202:45: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206:4 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206:4: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h:82:22 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h:82:22: error: unknown type name 'UIDataDetectorTypes'
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:54:22 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:54:22: error: unknown type name 'UIDataDetectorTypes'
/Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.h:56:10 /Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.h:56:10: error: cannot find protocol declaration for 'UIPopoverControllerDelegate'; did you mean 'UITabBarControllerDelegate'?
/Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.m:24:3 /Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.m:24:3: error: use of undeclared identifier 'UIUserInterfaceIdiomPhone'; did you mean 'UIUserInterfaceIdiom'?
【问题讨论】:
您要针对哪个基础 SDK 构建?您的机器上有哪些可用的? 【参考方案1】:我认为你已经导入了一个项目...
查看选择您的项目并转到其 INFO -> 在构建选项卡中 -> 架构 -> 在 Base SDK 中选择最新的 iOS -> 保存 n 关闭。现在选择模拟器(默认选择设备)。 然后运行应用程序。
已编辑:-
可能是 Xcode 3.2.4 或 SDK 配置中的错误。
尝试在您的构建设置预处理器宏中放置类似以下之一的行:
-D__IPHONE_OS_VERSION_MIN_REQUIRED=040100
或
-D__IPHONE_OS_VERSION_MIN_REQUIRED=030103
您也可以Check Here 处理您的问题。
希望对你有帮助:) Adios
【讨论】:
可能是因为您使用的是 LLVM 2.0。 LLVM 2.0 无法为 iPhone 模拟器构建。 GCC 4.2 工作正常。【参考方案2】:在 project.pbxproj 文件中,我不得不在几个地方进行更改:
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
到
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
【讨论】:
以上是关于基于 PhoneGap 的 iOS 应用程序缺少基本 SDK的主要内容,如果未能解决你的问题,请参考以下文章
Phonegap - 缺少 App Store 图标 1024x1024px App Store 图标
用于 Android iOS Windows 手机的基于 Phonegap 的移动持久数据存储
iOS - 使用不同支持的 iOS 版本的 Phonegap 构建项目的应用程序图标支持错误
iOS - 应用程序图标支持带有不同支持iOS版本的Phonegap Build Project的错误