80

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:

  • 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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Clay Bridges
  • 11,602
  • 10
  • 68
  • 118

4 Answers4

165

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 take on this issue.

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

One SDK to rule them all

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):

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.

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

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

(But) 3 is a magic number

Relax. You can still target devices running iPhone OS 3.0 (but not lower). The SDK you use to compile does 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.

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.

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.

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

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.

Fixing "Base SDK Missing"

  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.

Base SDK location for Xcode 4 and above

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

  • 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 )

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.

Community
  • 1
  • 1
Clay Bridges
  • 11,602
  • 10
  • 68
  • 118
  • 3
    Quick note for those as blind as I am that think the Project Settings item doesn't exist, it is Project > Edit Project Settings. – Lou Zell Jul 13 '10 at 17:02
  • 1
    'You can still download (from Apple!) and install a previous Xcode version (e.g. 3.1.4: Leopard, Snow Leopard).' that link is actually for 3.1.3 sdk, not 3.1.4. – Remover Jul 19 '10 at 10:12
  • 1
    **Folks:** this is a wiki, so feel free to fix stuff yourself. – Clay Bridges Jul 19 '10 at 15:05
  • Unfortunately, this doesn't help us to test our apps on a 3.x simulated environment. It is so easy to use a method which is not available in 3.x (or behaved differently in 3.x) and screwed up our apps. Not everyone has 2 iPhones to test on different OS versions, so for simple apps, I used to rely on the simulator to check compatibility. This sucks. – iamj4de Jul 20 '10 at 07:43
  • @iamj4de: **Reread**. You can use Xcode 3.1.3 to compile against any SDK, and to run against any simulator (that 3.1.3 supports, which is all of them, as I recall). Sucks less. – Clay Bridges Jul 20 '10 at 15:28
  • 2
    Note that the target settings override the project settings; you don't have to have it set in both places. I'd recommend that you don't set it in your target settings (& delete it if it is there) and then only set it in your project settings. BTW: If you do set it in your project settings make sure you have all configurations selected. (Or use the "General" tab and set it via the "Base SDK for All Configurations" pop-up). – geowar Jul 20 '10 at 21:17
  • Xcode 3.2.3 also has some major problems with "IMPORTING xcode 3.2.2 projects" ... and ... "Targets" (the build system has been changed by Apple in a NOT backwards-compatible way. I'd love to see a meta-question handling that. I've got an outstanding quetion on *one* of the ways this goes wrong here: http://stackoverflow.com/questions/3438606/how-to-make-xcode-3-2-3-build-a-specfic-architecture/3439425#3439425 – Adam Aug 09 '10 at 20:03
  • Still not addressed here -- I no longer show SDK version 3.2 as an option in the Base SDK dropdown. I don't see anywhere on Apple I can download it. – memmons Oct 05 '10 at 20:20
  • What about choosing between armv6 or armv7 architecture? Should we always build on armv6 if we are trying to target iPod Touch 2nd generation or iPhone 3G? – Craig Nicholson Oct 07 '10 at 09:55
  • Folks: there's a whole universe of possibly related questions that this community wiki doesn't address. If only there were a place to ask those questions, where they might get some attention... ;) – Clay Bridges Oct 08 '10 at 15:27
  • 1
    You might want to update this answer to include the new Latest SDK. – Steven Fisher Nov 30 '10 at 19:09
8

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.

John Stephen
  • 7,625
  • 2
  • 31
  • 45
  • why is this? it seems odd to have to close xcode and load back up just b/c of a setting change :O – RyBolt Mar 09 '11 at 18:30
  • Good question RyBolt, yet that's how it is. Apple must be caching something somewhere and a reload dumps it, but that's only a guess. – John Stephen Mar 10 '11 at 01:19
5

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).

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.2 Highly recommended!

NANNAV
  • 4,875
  • 4
  • 32
  • 50
SteveCaine
  • 512
  • 4
  • 13
  • Good info, Steve. I think my answer is a community wiki. Any chance you could edit it with the correct info. Thanks. – Clay Bridges Sep 28 '10 at 16:48
  • I'm new to StackOverflow and I think I need more 'points' before the site will allow me to edit posts made by others. The UI doesn't give me any obvious way to say 'edit this post' for your post. Sorry. – SteveCaine Oct 10 '10 at 20:57
3

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.

option/alt clicking the drop down

revealed some extra options that where very useful.