6

I duplicated a target and now I'm trying to delete it. Every time I try right clicking and deleting it, Xcode 5 crashes. I have no idea how to remove it. It's not like it's life-ending or anything, but it is annoying me. Has anyone had this problem? Here's what the log looks like:

'MyApp' has been asked for its build context but it does not belong to a project
3
  • Did Xcode log any error messages in Console.app? Oct 17, 2013 at 4:18
  • 2
    Delete derived data for that project and try again.
    – Adam
    Oct 17, 2013 at 4:20
  • @Adam Totally worked! Can you put that as an answer so I can mark this as closed.
    – Crystal
    Oct 17, 2013 at 4:41

4 Answers 4

6

Select other/different target project and then delete the duplicated one.

2

Delete derived data for that project and try again.

0
2

It is probably the dependency relationships between targets that cause this problem. I solved it by

  1. Duplicate the dependency target
  2. Remove the original(no the duplicated one) dependency target
  3. Remove the target that I actually want to delete
  4. Rename the duplicated dependency target to its original name
  5. Re-add the duplicated dependency target to those targets that rely on it
2

None of the above worked for me in the newer version of Xcode(8.3.3). Xcode was crashing if I try deleting a target. I tried the following steps and it worked for me.

  1. Remove the target from schema.
  2. Delete the folder which contains the target files.
  3. Now delete the target in Xcode.
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.