Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best solution for "No Scheme" issue in Xcode 4 after defected merging git branches

Got the "No Scheme" issue after merging the conflict issue

Auto-merging SampleProject.xcodeproj/project.pbxproj CONFLICT (content): Merge conflict in SampleProject.xcodeproj/project.pbxproj Automatic merge failed; fix conflicts and then commit the result.

Definitely I took some defected operations when merging the conflicts. The question is that does there has any best solution to fix the "No Scheme" issue in this kind of case.

like image 264
Forrest Avatar asked Apr 12 '12 03:04

Forrest


3 Answers

When Schemes shows "No Scheme" option, Click on

No Scheme -> Manage Scheme -> then click the button Autocreate Schemes Now

like image 117
Gobi M Avatar answered Feb 05 '23 09:02

Gobi M


I found the top rated answer didn't work for me so thought I would post my usual approach here - as I just had to solve this problem:

We know the problem - the error is actually quite clear on this issue:

Auto-merging SampleProject.xcodeproj/project.pbxproj CONFLICT (content): Merge conflict in SampleProject.xcodeproj/project.pbxproj Automatic merge failed; fix conflicts and then commit the result.

We have a conflict in the project.pbxproj file.

If it said "Conflict in appDelegate.h" we'd know exactly what to do but the fact the project won't compile seems to be more worrying than a normal conflict - which is what this actually is.

So how do we go about fixing this conflict?

  1. First navigate to your project file
  2. Right click the xcodeproj file
  3. Click Show Package Contents

enter image description here

  1. Double click the project.pbxproj file (that's the the one mentioned in the conflict error)

enter image description here

  1. Finally resolve the conflicts as you would normally do. This requires a little bit of thought - it is worth reading and trying to understand approximately what is happening. Usually though it is quite straight forward to see what needs to be kept:

enter image description here

Above is an example of how the conflicts will look.

Once you have found all the conflicts in this file just save and reload the project. The scheme should be back and the project working.

Note: As mentioned above some thought is required when resolving the conflicts. Usually they will be very easy (just remove the conflict lines) but sometimes you will need to fix a little bit of code. If you see the example below - the file had been corrupted and needed to be fixed:

enter image description here

The fix required in this example was:

        path = DetailModels;
        sourceTree = "<group>";
    }; 

This code needed to be added and could be worked out from the code in the above areas.

like image 30
sam_smith Avatar answered Feb 05 '23 09:02

sam_smith


Similar issue. Closed my projects, quit then re-opened XCode and my schemes were back.

like image 28
software evolved Avatar answered Feb 05 '23 11:02

software evolved