使用 iPhone SDK 4 安装 Xcode 3.2.3,得到“Base SDK missing”,看不到其他 SDK

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3161385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:27:04  来源:igfitidea点击:

Install Xcode 3.2.3 w/ iPhone SDK 4, get "Base SDK missing", can't see other SDKs

iphonexcodeios4

提问by Clay Bridges

I created this community wiki to bind together a number of other Q/A's I've seen here on SO. If you're here, you've probably installed the final version of Xcode 3.2.3 with iPhone SDK 4 (download link, reg reqd), and then encountered one or both of these problems:

我创建了这个社区 wiki 来将我在 SO 上看到的许多其他 Q/A 绑定在一起。如果您在这里,您可能已经安装了带有 iPhone SDK 4 的 Xcode 3.2.3 最终版本(下载链接,reg reqd),然后遇到了以下一个或两个问题:

  • In your previously working Xcode iPhone project, you get "Base SDK Missing" somewhere. Something like this:

    Ruh-roh!

  • In a related but more general observation, none of the previously available panoply of Device or Simulator SDK choices (e.g. 3.0, 3.1, 3.1.3, ...) is available where you used to see them.

  • 在您之前工作的 Xcode iPhone 项目中,您会在某处看到“Base SDK Missing”。像这样的东西:

    呵呵呵!

  • 在一个相关但更一般的观察中,以前可用的设备或模拟器 SDK 选择(例如 3.0、3.1、3.1.3、...)在您以前看到的地方都不可用。

回答by Clay Bridges

Overview

概述

I'm going to explain why this is going on, and then how fix the specific "Base SDK Missing" problem. You can skip to the bottom for just the fix, though I recommend reading all of this. I also recommend John Muchow's excellent takeon this issue.

我将解释为什么会这样,然后如何解决特定的“Base SDK Missing”问题。您可以直接跳到底部进行修复,但我建议您阅读所有这些内容。我还建议约翰Muchow的优良采取这个问题。

If you are specifically interested in the Xcode 3.2.4 upgrade, which has a strongly related problem, you might want to confer here.

如果你对 Xcode 3.2.4 升级特别感兴趣,它有一个强烈相关的问题,你可能想在这里交流

One SDK to rule them all

一个 SDK 来统治所有这些

Here's the deal: 4.0 is now the only SDK version allowed for submitting new or updated iPhone-only apps. This is direct from Apple's iOS 4 Readiness Checklist(reg reqd):

交易如下:4.0 现在是唯一允许提交新的或更新的仅限 iPhone 的应用程序的 SDK 版本。这直接来自 Apple 的iOS 4 Readiness Checklist(reg reqd):

All new applications and updates to existing applications must be built with iPhone SDK 4. Please note, the App Store will no longer support applications that target iOS 2.x.

所有新应用程序和现有应用程序的更新都必须使用 iPhone SDK 4 构建。请注意,App Store 将不再支持面向 iOS 2.x 的应用程序。

Presumably -- I'm guessing here -- iPad-only and universal apps should use the 3.2 SDK. Thatis why 4.0 & 3.2 are your only choices for SDKs.

大概 - 我在这里猜测 - 仅限 iPad 和通用的应用程序应该使用 3.2 SDK。就是为什么 4.0 和 3.2 是您对 SDK 的唯一选择。

That is also why your project is now broken, since the SDK it was previously mapped to is deprecated, gones-ville.

这也是您的项目现在已损坏的原因,因为它之前映射到的 SDK 已弃用,gos-ville。

(But) 3 is a magic number

(但是) 3 是一个神奇的数字

Relax. You can still target devices running iPhone OS 3.0 (but not lower). The SDK you use to compiledoes not limit -- downward-- what iOS version you can program to or support. Once you've patched things up in your project etc. (cf. next section) you can set "iPhone OS Deployment Target" to a lower iOS version. For a quick shot of how to do this, cf. step 7 in the next section.

放松。您仍然可以定位运行 iPhone OS 3.0(但不能更低)的设备。您用于编译的 SDK不限制 -向下- 您可以编程或支持的 iOS 版本。一旦你在你的项目等中修补了一些东西(参见下一节),你可以将“iPhone OS 部署目标”设置为较低的 iOS 版本。要快速了解如何执行此操作,请参阅。下一节的第 7 步。

Note that you are now entering some tricky terrain. Your usual Xcode 3.2.3 compiler will no longer be enforcing your compliance to 3.0-only calls, nor does it have a simulator for these. And if you want to support 4.0 features, you'll have to do some conditional code to prevent crashes on 3.0 devices. Fun.

请注意,您现在正在进入一些棘手的地形。您通常使用的 Xcode 3.2.3 编译器将不再强制您遵守 3.0-only 调用,也没有用于这些调用的模拟器。如果你想支持 4.0 的特性,你必须做一些条件代码来防止在 3.0 设备上崩溃。乐趣。

You can still download (from Apple!) and install a previous Xcode version or SDK (cf. here). Yes, you can install multiple Xcode versions, in different directories, i.e. put only one version in /Developer. You can use the old Xcode to test your app's compliance vs. a 3.x SDK, moving the hard work to a fancy compiler, and simulator. But you can no longer use the products of the previous SDKs to submit to the app store.

您仍然可以下载(从 Apple!)并安装以前的 Xcode 版本或 SDK(参见此处)。是的,您可以在不同的目录中安装多个 Xcode 版本,即在 /Developer 中只放置一个版本。您可以使用旧的 Xcode 来测试您的应用程序与 3.x SDK 的合规性,将繁重的工作转移到花哨的编译器和模拟器上。但是不能再使用之前SDK的产品提交到应用商店。

FWIW, I plan on doing just this check before I ship.

FWIW,我打算在发货前做这个检查。

What condition my condition is in

我的情况是什么情况

Matt Gallagher has a Cocoa with Love post on version conditional code entitled "Tips & Tricks for conditional iOS3, iOS3.2 and iOS4 code". If you are planning on conditionally using 4.0 features, this is a strong recommendation to check it out.

Matt Gallagher 有一篇关于版本条件代码的 Cocoa with Love 帖子,标题为“条件 iOS3、iOS3.2 和 iOS4 代码的提示和技巧”。如果您计划有条件地使用 4.0 功能,强烈建议您检查一下。

Fixing "Base SDK Missing"

修复“缺少基础 SDK”

  1. Load your project
  2. From the menu, select Project > Edit Project Settings...
  3. Under Architecture > Base SDK, choose one of the available device options: iPhone 3.2 or iPhone 4.0. If you are iPhone-only, 4.0 is the way to go.
  4. Close that window.
  5. From the menu, select Project > Edit Active Target "YourTarget"
  6. Under Architecture > Base SDK, choose one of the available device or simulator options: iPhone 3.2 or iPhone 4.0.
  7. If you want to target previous iOS versions, then in that same window, under Deployment > iPhone OS Deployment Target, select the lowest version you want to support. Note that support for 2.x versions through the app store is deprecated. See the "Readiness Checklist" quote above.
  1. 加载你的项目
  2. 从菜单中,选择项目 > 编辑项目设置...
  3. 在架构 > 基础 SDK 下,选择可用设备选项之一:iPhone 3.2 或 iPhone 4.0。如果您只使用 iPhone,那么 4.0 是您的最佳选择。
  4. 关闭那个窗口。
  5. 从菜单中,选择项目 > 编辑活动目标“YourTarget”
  6. 在架构 > 基础 SDK 下,选择可用的设备或模拟器选项之一:iPhone 3.2 或 iPhone 4.0。
  7. 如果您想针对以前的 iOS 版本,则在同一窗口中,在“部署”>“iPhone OS 部署目标”下,选择您要支持的最低版本。请注意,不推荐通过应用商店支持 2.x 版本。请参阅上面的“准备清单”引用。

Base SDK location for Xcode 4 and above

Xcode 4 及更高版本的基本 SDK 位置

Follow the steps above, but for Step #2, click the following:

按照上述步骤操作,但对于第 2 步,请单击以下内容:

  • Select the Project navigator using folder icon on the left of the navigator sidebar
  • Select the Project, which will be at the top of that view.
  • The project configuration will appear in the main editor panel; select "Build Settings" at the top and below will be the 'Architecture' section.
  • 使用导航器侧边栏左侧的文件夹图标选择项目导航器
  • 选择位于该视图顶部的项目。
  • 项目配置将出现在主编辑器面板中;选择顶部的“构建设置”,下方将是“架构”部分。

      Project navigator          Build Settings

      项目导航          构建设置

(This answer is a slightly-adapted version of Sherman Lo's answer)

(这个答案是Sherman Lo答案的稍微改编版)

Addendum

附录

More detailed information on this topic can also be found in the first answer to this question. There's also some useful info here.

有关此主题的更多详细信息,也可以在此问题的第一个答案中找到。还有一些有用的信息在这里

回答by John Stephen

If you fix your settings and still see "Base SDK Missing" and can't build, reload your project. I exited Xcode, but closing and re-opening would probably also work.

如果您修复了设置但仍然看到“缺少基础 SDK”并且无法构建,请重新加载您的项目。我退出了 Xcode,但关闭和重新打开可能也有效。

回答by SteveCaine

The links given by Clay Bridges to download earlier versions of Xcode and iPhone OS SDKs do not work. However editing these links to replace the first instance of 'iphone' with 'ios' does work, at least for the Snow Leopard link (downloading now).

Clay Bridges 提供的用于下载早期版本的 Xcode 和 iPhone OS SDK 的链接不起作用。然而,编辑这些链接以用“ios”替换“iphone”的第一个实例确实有效,至少对于 Snow Leopard 链接(现在下载)。

The correct links, plus information on installing older iOS SDKs into newer Xcode installs, came from this blog entry by Chris Fletcher: howto install iphone sdk 2.0.3.1 for xcode 3.2Highly recommended!

正确的链接,以及将旧 iOS SDK 安装到新 Xcode 安装中的信息,来自 Chris Fletcher 的这篇博客文章:howto install iphone sdk 2.0.3.1 for xcode 3.2强烈推荐!

回答by SteveCaine

I had this same problem as well. I also had an issue when using multiple targets switching back to a previous target xcode would forget to change a few things, like switching from an iOS target to a MacOS target.

我也有同样的问题。当使用多个目标切换回以前的目标时,我也遇到了一个问题,xcode 会忘记更改一些内容,例如从 iOS 目标切换到 MacOS 目标。

option/alt clicking the drop down

选项/alt 单击下拉菜单

revealed some extra options that where very useful.

揭示了一些非常有用的额外选项。