Fixing "Base SDK Missing" error with Xcode 3.2.5 and iOS SDK 4.2
If you just updated to Xcode 3.2.5 and iOS SDK 4.2, you might find that your existing projects do not compile. This probably doesn't surprise you as it's been the way for every SDK update as far back as the beginning of time (at least in the Jobsian calendar). Thankfully, with Xcode 3.2.5, you can set your base SDK once and for all and it should work for all future releases.
But first things, first, here's the error I received while trying to compile one of the early projects from my iOS SDK workshop: "error: there is no SDK with the name or path 'iphoneos4.1'"
Also, when I looked under the Overview drop-down in Xcode, I noticed that the settings there were entirely wrong:
To fix the Base SDK Missing error (once and for all), I opened up the Project Settings (Project &rarrow; Edit Project Settings) and, under the Build tab, set the Base SDK setting to "Latest iOS (currently set to iOS 4.2)".
Closing the Project Settings, however, did not update the Overview drop-down and I could only build for the device, not the simulator.
To fix this, I had to restart Xcode.
Update: You don't have to restart Xcode: closing the project and reopening it also fixes it. Thanks to Amar Kulo for the heads up.
After restarting Xcode, the Overview drop-down displayed the correct information and I was up and running again.
I hope this helps you if you encounter the same issue after upgrading to Xcode 3.2.5 and iOS SDK 4.2.
Happy coding!
Update: The core frameworks will also appear to be missing initially. This, too, will be fixed after you re-open the project so don't go through the effort of re-importing them.
Update: Also, if in 4.1, you added the iOS SDK 4.1 workaround for the CGPDFContext.h:60:23: error: expected function body after function declarator
error, you need to remove this or you will get a warning: '__IPHONE_OS_VERSION_MIN_REQUIRED' macro redefined.
If you get this warning, check whether you added the -D__IPHONE_OS_VERSION_MIN_REQUIRED=040100
flag to the Other C Flags in Project Settings or whether you added the two defines listed in my blog post, above, in the Prefix.pch file for your project. Remove the flag and/or the defines to remove the warning.
Update: I also had thousands of warnings on a project that uses the Google Toolbox for Mac HTTP Fetcher and had the -Xclang -fobjc-nonfragile-abi2
flag set in the project (this allows you to skip @synthesize statements and implicitly creates the, umm, implicit accessors). Removing the compiler flag removed the 20,000 or so warnings also. For the record, I consider this a WIN.
Comments
by NO3 rush on 2010-11-26 09:52:25
by Adam Eberbach on 2010-11-24 23:02:16
by Giovambattista Fazioli on 2010-11-24 23:21:22
by Ben Reed on 2011-02-02 10:41:14
by Joe Moniz on 2011-01-23 22:24:22
by sid on 2010-12-20 16:56:37
by Dominic Mitchell on 2010-11-24 23:50:15
by Andy Elliott on 2010-11-25 15:40:23
by Edgar Schmidt on 2010-11-27 00:09:03
by Eric O'Connell on 2010-11-29 05:36:10
by John Adkins on 2010-12-02 03:55:05
by Scott on 2010-12-17 04:49:23
by joshuafielder on 2011-02-11 15:06:18
by Nando Lambrusco on 2011-02-03 17:19:40
by sudesh kumar on 2011-01-11 08:39:22
by andrea on 2011-02-24 22:32:43
by Martin on 2011-05-12 13:03:48
by peterrory on 2011-04-12 21:20:14
by sreeram somanchi on 2011-04-21 07:24:30
by MS on 2012-07-09 11:47:57
by MS on 2012-07-09 12:04:00