25

I download a sample of UICatalog and run it.When I compile it ,it shows the failed message:There is no SDK with the name or path "iphoneos4.0".I find the "Base SDK" of UICatalog's Targets is iphone Device 4.0(missing).How can I solve this question and run it.

Thank you!

lqf
  • 299
  • 1
  • 3
  • 9

15 Answers15

35

Select the root level of the project, in "Groups & Files". It's blue. Then hit command-I to get its Info.

Pick "Build" from the segmented controller at the top of the info window. In the first section of that panel you'll see Base SDK as one of the first few lines of options. Select the latest version of the SDK you find in there, and close the window to save your options.

Build-and-run the project, and you should be good to go.

EDIT, because I see from the comments that people are finding this answer who have a slightly different question than the OP's, so here's one other thing to try. It could also be you have "iOS Device" selected as your build target. If so, and if what you really want is for it to launch into the simulator, select "Simulator" instead.

Dan Ray
  • 21,623
  • 6
  • 63
  • 87
  • 8
    Did you try what I said? I didn't give you advice, I gave you instructions. Advice would sound like, "Go into plastics". – Dan Ray Aug 03 '10 at 11:58
  • You're going to need to say some more about what happened, then. If you follow those instructions, it solves that problem. – Dan Ray Aug 04 '10 at 11:56
  • The problem is:"error: There is no SDK with the name or path 'iphoneos4.0'". – lqf Aug 09 '10 at 03:15
  • I bet your Xcode installation is out of date. Try getting the latest version from Apple. – Dan Ray Aug 09 '10 at 17:18
  • 3
    @lqf: If this didn't solve your problem, you shouldn't accept it as your answer. Accepting this as your answer is misleading to others with the same problem. – Erik B Oct 25 '10 at 13:13
  • I have to agree with @lqf - this didn't solve my issue as well. Newest iOS SDK, downloaded a sample from apple developer sample code http://developer.apple.com/library/ios/navigation/index.html?section=Resource+Types&topic=Sample+C#section=Resource%20Types&topic=Sample%20Code (the Animation Gestures) and couldn't compile due to same error. Also, all framework files are red. Also I have to agree with Erik - lqf shouldn't have accepted this. – cregox Nov 09 '10 at 19:58
  • Oh, now I insisted on it a little bit more and it **did solve the issue** so I retract (without deleting) all I said before. The problem is I was selecting iOS Device 4.1 (it was previously selected iOS Device 4.0). Once I instead chose iOS Simulator 4.0, I could run it in simulation! :D – cregox Nov 09 '10 at 20:02
  • Just a last comment, iOS Simulator 4.1 didn't work. And if I create a new project, it comes as iOS Device 4.1, and it does work fine. So, while this solved my current issue it doesn't seem like a good solution to me. – cregox Nov 09 '10 at 20:11
  • Dan's solution worked for me. Switched to "iPhone Simulator 4.1" and my project now builds. – Zubin Dec 27 '10 at 21:04
21

After loading the project into XCode..

Under Groups and Files

  1. right click on UICatalog<-(or your demo project name) and select Get Info

  2. in Base SDK select IOS Simulator 4.1

  3. Close and save info pane

  4. expand Targets exposing UICatalog<-(or demo project name)

  5. right click on UICatalog and select Get Info

  6. in Base SDK select IOS Simulator 4.1

Combo box in UICatalog project pane (upper left corner) should switch to "Device - 4.1 | Debug" instead of "No Base SDK"

if you Build and Run at this point you might get another error. If so, open the UICatalog combo and switch from Device to Simulator

The "official link" mentioned above states…

"Note: Targets can override build settings defined at the Project level. "

..but should probably read "will" instead of "can"

takrl
  • 6,356
  • 3
  • 60
  • 69
Larry
  • 211
  • 2
  • 2
5

Ok, I've solved it.

  1. In Groups & Files go to Targets and select your target.
  2. Press Ctrl+I (or open the info in some other way)
  3. Set the Base SDK of your target

(The Base SDK should also be set at the project)

Daniel
  • 20,420
  • 10
  • 92
  • 149
  • 1
    The base SDK shouldn't be set in a target; delete it from there and set it via the Project's "Build" tab. – geowar Oct 03 '10 at 06:35
  • The targets do not have to be deleted. They just have to be set to the right Base SDK as well since they may override the project's base SDK. – Daniel Oct 04 '10 at 10:17
  • what geowar meant is that if you press "delete" on it, it will be set to default, which is the right Base SDK if you set it right on the project. – cregox Nov 09 '10 at 23:18
  • yes, but you also delete all other configurations of the target if you do it that way. – Daniel Nov 22 '10 at 10:10
4

Steve nailed it. This is an Xcode bug. I loaded the NavBar sample and Xcode didn't even offer the simulator as an option, and it complained about the missing SDK even though it was set correctly in the project and wasn't set at all on the target.

Do what Steve said: "The only way I could resolve it (in fact, the only way I could get the option of running in the simulator at all) was to change from debug to release and back. The dropdown still shows Base SDK Missing but if you click it, the simulator options are there and it builds."

Oscar
  • 2,039
  • 2
  • 29
  • 39
  • If you restart Xcode it will also "refresh" this and update the drop down properly to the selected SDK. – Maurizio Jan 11 '11 at 02:16
2

My problem was that in the sample code another xcodeproj was embedded. So I looked after that file with Finder, opened it with Xcode and than the same as Dan said: Project -> Edit Project Settings -> Under "Architectures" set Base SDK to "iPhone Simulator x.x" (the latest one you have installed)

testing
  • 19,681
  • 50
  • 236
  • 417
2

I had the same issue with another Apple sample app. The only way I could resolve it (in fact, the only way I could get the option of running in the simulator at all) was to change from debug to release and back. The dropdown still shows Base SDK Missing but if you click it, the simulator options are there and it builds.

I think that's a bug.

Steve
  • 6,332
  • 11
  • 41
  • 53
  • same thing here, except changing from debug to release doesn't solve it. trying now **TouchCells** – cregox Nov 09 '10 at 22:50
2

Many answers here, none seem to be complete enough about this, and it's all a mess. But they are all helpful. Here, I just want to compile all helpful pieces in one answer. Thanks to Larry (who have almost everything compiled into steps already), Steve, Dan Ray, dkk, geowar and lqf.

Setting Base SDK

This picture from apple is a little decieving and outdated (talking about iOS SDK 4.0 and we're currently at 4.1) but it does show where you should change the project settings. Just select iPhone Simulator 4.0 if it was previously on iPhone Device 4.0.

Other than that, they say "Targets can override build settings defined at the Project level". So, yeah, also go ahead, open Targets and set all of their Base SDK back to default by pressing delete on it. If they were bolded, they'll become regular indicating a default value, which should be iPhone Simulator 4.0 if you did the first step right.

Just realize there are many places where Base SDK can be wrong:

  • Under Project Info
  • Under Target Info
  • Under different configurations for both Project and Target

And that under Target it should be set to default, which is value from Project.

There's still something about the overview combo sometimes having and sometimes not having more than 1 option such as "Device" and "Simulator" that I just couldn't understand yet, but this is another potential configuration place for Base SDK being wrong.

cregox
  • 17,674
  • 15
  • 85
  • 116
1

You have to make sure that you change to the "iPhone Simulator" under the project settings in the appropriate configuration (i.e. if you are building a debug build you have to change to the simulator under the debug configuration).

For some reason I was getting this error when I did change the simulator but realized that I was doing a debug build but changed to the simulator under the release configuration and not the debug configuration.

1

dkk's answer is what made things work for me. I had to change the Base SDK on the target and not just the project. Perhaps you have to do both.

adolfox
  • 31
  • 3
  • 1
    The base SDK shouldn't be set in a target; delete it from there and set it via the Project's "Build" tab. – geowar Oct 03 '10 at 06:36
  • don't know @geowar Try downloading TouchCells from apple's sample and see what you can do without dkk's hint. +1 for adolfox here. – cregox Nov 09 '10 at 23:05
  • Oh now I see @geowar. By "delete" you mean to set it back to default. Interesting. – cregox Nov 09 '10 at 23:12
1

I got a similar error after upgrading my iPhone to iOS4.2.1(8C148a). The situation is as following.

I was using Xcode 3.2.4, but it does not support iOS4.2.1. So I downloaded Xcode_3.2.5_and_ios-sdk_4.2_final.dmg which is 3.78GB requiring 9.53GB to install. Then I ran my ap with Xcode 3.2.5. That is where I got the above error message.

Now it is ok. I solve this based on Geowar's answer:

Please be noted that if you have done as Geowar said and the message is still there. Try to close Xcode 3.2.5 and restart it. That is how it works for me.

Another thing is that if you have just upgraded to iOS4.2.1 like me. When you try to load the a/p from Xcode 3.2.5 the first time. Xcode 3.2.5 may still give you "No provision iOS device connected". Please try to go to organizer and click on your iPhone under DEVICES on the left bar. Wait for a while to let Xcode in sync with your iPhone with iOS4.2.1. Then it will work. At least it work for me.

Jesse

jesse
  • 31
  • 2
1

Ok, so I struggled through this too. Based on some of the answers above and from the apple development forum, I was able to figure out what worked for me.

In XCODE, if you notice that the pull down at the top left of the window says "BASE SDK MISSING", you are going to get this error "There is no SDK with the name or path “iphoneos4.0”". To fix the problem:

  1. double click on Group & Files in the upper part of the left pane of xcode. This will open a window

  2. go to the Build tab of the new window

  3. click on the row that says "BaseSDK" and select "Latest iOS (currently set to iOS 3.2)

  4. The Configurations pull down near the top should now say "All Configurations". If not, set it.

  5. close the window.

  6. Now if you try to build, you will get a different error, something like: Code Sign error: The identity 'iPhone Developer: x Xxxxx' doesn't match any identity in any profile ...

  7. So, now what you need to do in xcode is to click on the pull down in the upper left corner (the pull down that had the original BASE SDK MISSING indication, but probably has something different now), and make sure that both "Simulator" and "Debug" are checked as options in the pull-down.

  8. now you should be good to go.

takrl
  • 6,356
  • 3
  • 60
  • 69
Jeff Bonta
  • 21
  • 2
0

I just went Project -> Edit Project Settings -> Build -> then change the Base SDK to iPhone 4 simulator or I'm assuming whichever SDK you want to use. I never had to specify the build for a given target, although my program was created on a mac that was already configured to use the iPhone 4.0 simulator.. so perhaps the targets were set for the simulator SDK and the project itself wasn't? Either way... just glad it works.

randomness
  • 23
  • 1
  • 4
0

I was having the same problem and what I did to solve it was:

  1. Go to Menu Project
  2. Go to Set Active SdK
  3. Select the option SIMULATOR instead of DEVICE
  4. Build and Run and the ERROR has gonne!

I hope it works for you guys... =)

Victor
  • 1
  • 2
    as I said on the accepted answer comments, yeah, this is what "solved" the error for me... but it looks like not a real solution. – cregox Nov 09 '10 at 20:16
0

I just had a situation where I changed the Base SDK to 4.2 on my project after updating to Xcode 3.2.5, but I kept on getting the "There is no SDK..." error. I finally opened the project file (MyProject.xcodeproj/project.pbxproj) in a text editor and looked around. There was no mention of 4.0 anywhere, only 4.2. BUT when I then saved that file, it all started working in Xcode. Perhaps some permission on the file or something else. Have no idea really, but it worked.

Felixyz
  • 19,053
  • 14
  • 65
  • 60
0

I got this error when one of my configurations still referenced an old (iOS) SDK. Note that the error shouldn't have come up when I tried to build a totally different configuration (with correct Base SDK setting), so this smells like an XCode bug to me. People suggesting that you don't set the base SDK in at target-level have probably never created projects which contain targets for different platforms all in one project file (in my case Mac and iOS targets, so setting the base SDK once in the project file is nonsense advice).

zmippie
  • 1,509
  • 2
  • 17
  • 22