Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

duplicate device scheme in xcode 4

Tags:

xcode

When I look at my schemes in xcode 4 after I connect my iPad, I see two schemes listed for my device (one to the right of my project name in the drop down list, and one right underneath it). I don't see any discernible difference in the schemes when I select Edit Scheme, but when I try to build the topmost one, I always get errors such as:

Cannot find protocol declaration for 'NSXMLParserDelegate'

Does anyone know why there are two device schemes or why the topmost one gets errors like the above one (but not the second one)?

like image 452
Joey Avatar asked Mar 29 '11 21:03

Joey


4 Answers

I had the same problem. I found two SDKs in my Xcode.app:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/
iPhoneOS4.3.sdk
iPhoneOS5.1.sdk

I delete an old SDK iPhoneOS4.3.sdk, now everything is ok.

like image 113
ryohey Avatar answered Nov 20 '22 12:11

ryohey


These device entries were actually labelled in some previous versions of Xcode as -

  1. (your device) overriding base SDK to iOS (device iOS version)
  2. (your device) with project settings
like image 29
Daniel Broad Avatar answered Nov 20 '22 12:11

Daniel Broad


Xcode is displaying a device scheme for each of the iOS SDKs you have on your system.

If you want to remove those duplicate devices, you can either delete or move old SDK versions out of the system folder they reside in -

MACHD/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/...

Delete or transfer the old SDKs and relaunch Xcode to notice the updated device schemes. I'm not sure if you really want to be removing those SDKs... but that will get rid of those extra duplicate devices.

like image 2
Evan Avatar answered Nov 20 '22 13:11

Evan


I had the same problem with an Xcode3 project when I upgraded it to Xcode4. I would have 5 "device" entries appear for each device I connected, but only the bottom-most one in the list would actually build successfully. I couldn't find any combination of settings that would resolve it, so I exported the scheme (which looked fine), deleted it, and let Xcode generate a new one. It's working fine now, so it must be some issue in the migration path.

like image 1
Greg Haygood Avatar answered Nov 20 '22 12:11

Greg Haygood