PDA

View Full Version : Unrecoverable XCode Project


queasy
2005.03.26, 04:10 AM
Hi folks,

I'm new to this board -- just got my first Mac a couple days ago actually. Coming from an x86/Win32 background, I'm still quite the newbie to this whole other world of computing.

Anyway, in the the process of porting my game (http://www.queasygames.com/gate88) to OSX I found this rather strange problem with XCode. If I follow these steps:

1. Open XCode
2. File -> New Project
3. Choose SDL OpenGL Application
4. Drag-and-drop "Targets" into the "Products" group.
5. File -> Close Project
6. File -> Open Project -> select whatever the project name was called

I get this error:
"
Internnal Error
File: /SourceCache/DevToolsBase/DevToolsBase-387/pbxcore/PBXContainer.m
Line: 465
Object: <PBXProject:0x04125560>
Method: setItem:forGlobalID

guid should be an instance inheriting from PBXGlobalID, but it is nil
"
It repeats similar error messages until finally it just gives up and does not open the project. So my question is, if I accidentally followed the above steps, how do I fix my project so that I can open it again?

Thanks!

-j

Taxxodium
2005.03.26, 04:44 AM
Why did you put the Targets group inside the Products group, that doesn't make any sence at all.

Now, since your project cannot be reopened again, the only way to recover it is by creating a new project, the same way you did before but leaving the Targets and Products groups alone, and then add your source code to the project

queasy
2005.03.26, 06:58 PM
yea... obviously it's a dumb move, but why wouldn't xcode warn me that it is? Why would it just let me go ahead and do something that's unrecoverable? Even if I didn't close the project, it still wouldn't let me undo what I did. If others are able to reproduce this bug (?) then I find it curious how a company that prides itself on UI design would allow this to happen.

Anyway, I did some hacking around the project.pbxproj file with textedit and found that if you do a search for "target" and manually delete that group from the file, you should be able to load the project in xcode again.

The part to delete looks something like this:


1C37FBAC04509CD000000102 = {
children = (
);
fallbackIsa = PBXGroup;
isa = PBXTargetSmartGroup2;
name = Targets;
refType = 4;
sourceTree = "<group>";
};


Note the "name = Targets" line. Also, above it, after some garbage, will be a similar block with a line that reads "name = Products"

Hopefully this will serve as a better remedy than:


Now, since your project cannot be reopened again, the only way to recover it is by creating a new project, the same way you did before but leaving the Targets and Products groups alone, and then add your source code to the project


If anyone else has any better solutions, let me know!

-j

Taxxodium
2005.03.26, 07:19 PM
Why would it just let me go ahead and do something that's unrecoverable?


Why don't you file a bug report (https://bugreport.apple.com/)?


If anyone else has any better solutions, let me know!


Huh? My method takes less than a minute to setup..

queasy
2005.03.26, 07:46 PM
Not if you have a ton of files all organized into varoius groups with changes to the compiler settings. You'd have to reset all the settings and what not.

-j

ps: oh, i've been looking for that link (the bug-report filing link) thanks!