29

Xcode4.2 Edit Schemes dialogue

I want to delete this red-marked target, but am unable to.

The "minus" button in the dialogue remains greyed-out, it doesn't respond to backspace or delete keys and right-clicking just brings up help options. I can drag the missing-red-marked target above or below the working black target, but it doesn't let me delete it.

This missing red target only seems to appear in this edit schemes dialogue.

In my main project/target window, I just have the one good target there.

Any ideas how to clean this up and delete this missing target?

SubG
  • 740
  • 1
  • 7
  • 14

6 Answers6

43

What worked for me was to designate another executable (or none) in the existing scheme's various actions (run, test, etc.). It's the fact it's in use in the scheme's actions that prevents its deletion. I discovered this during my research for Mastering Xcode 4 (yes, shameless plug). :-)

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
  • 4
    solved it for me. i had the wrong executable assigned in Profile. changing that to the correct app automatically removed the bogus target. thanks! – John Mar 13 '13 at 14:38
  • Wow, thanks for the tip! Just shows you can never assume anything. – phatmann Mar 21 '13 at 16:36
  • For the win! Wish the OP would accept this answer, as it's the correct one. – Tim Keating Apr 01 '13 at 19:30
  • This is the better answer. Much simpler and fixes the problem without creating new schemes. – Chris Miles Apr 06 '13 at 03:39
  • thanks, yeah you will be able to remove the missing target once the dependencies to that target have been removed. You can see the dependencies that are uncheckable because they are grayed out. In my case I had to select the non missing dependency in Run and Profile sections in the executable section. – yeahdixon Mar 27 '14 at 22:56
8

The real issue here is explained by Joar Wingfors in the Xcode-users mailing list (emphasis mine):

In the scheme sheet you cannot delete things from one tab that some other tab depend on. In this case you probably have to delete the target from the test tab before you can delete it from the build tab. Or something along those lines.

Ohad Schneider
  • 36,600
  • 15
  • 168
  • 198
8

Try creating a brand new scheme (via "New Scheme" or "Manage Schemes...") and start using that.

Once your new scheme is building properly and is set as a default, you should be able to delete the old scheme with the bogus "missing" target.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • Aye, that works - interestingly, "Duplicate Scheme" also duplicates the missing target too, so it has to be a brand new scheme. Only disadvantage this way is losing any non-default original scheme settings. – SubG Dec 08 '11 at 22:11
0

I had the exact same problem. Solved by closing the xCode and externally editing the schema file to delete the bundlableResource section for the missing library. Not the safest of all methods but it works.

N3al
  • 171
  • 1
  • 6
0

First delete all schemes and then generate the schemes again. Work for me .

frank
  • 2,327
  • 1
  • 18
  • 20
-1

What Joshua said, a bit tailored. Go through all various actions and change the missing executable to an existing one.

In your case, go to 'Profile' and switch to the new app. Same if you encounter this in 'Test' tab.

Marius
  • 3,589
  • 3
  • 27
  • 30