4

I have the following Problem with one of my Projects:

If I add any file or group to it, XCode stalls and crashes shortly after. If I do a project clean before that, it works just fine. As soon as I did a Project build it will crash again if I try to add files.

Any ideas? searched for a solution but without any luck. I am using the newest XCode 4.3.2 - A new install did not help.

Crash Report of XCode:

Process:         Xcode [7017]
Path:            /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:      com.apple.dt.Xcode
Version:         4.3.2 (1177)
Build Info:      IDEApplication-1177000000000000~6
App Item ID:     497799835
App External ID: 7171108
Code Type:       X86-64 (Native)
Parent Process:  launchd [139]

Date/Time:       2012-04-11 16:46:18.177 +0200
OS Version:      Mac OS X 10.7.3 (11D50)
Report Version:  9

Interval Since Last Report:          137545 sec
Crashes Since Last Report:           10
Per-App Interval Since Last Report:  135817 sec
Per-App Crashes Since Last Report:   10
Anonymous UUID:                      F3C112A1-E15B-4D44-9662-F13A93846AE0

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 4E2002
UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[PBXFolder targets]: unrecognized selector sent to instance 0x40b7b63e0
UserInfo: (null)
Hints: None
Backtrace:
  0  0x00007fff95298faa __exceptionPreprocess (in CoreFoundation)
  1  0x00007fff99458d5e objc_exception_throw (in libobjc.A.dylib)
  2  0x00007fff953252ae -[NSObject doesNotRecognizeSelector:] (in CoreFoundation)
  3  0x00007fff95285e73 ___forwarding___ (in CoreFoundation)
  4  0x00007fff95285c88 _CF_forwarding_prep_0 (in CoreFoundation)
  5  0x000000011175717e -[XCProjectReferenceInfo _synchronizeWithReferencedProjectIfNeeded] (in DevToolsCore)
  6  0x0000000111757dc2 -[XCProjectReferenceInfo archivableInfoDictionary] (in DevToolsCore)
  7  0x000000010dfd3c47 -[NSArray(DVTFoundationClassAdditions) dvt_arrayByApplyingSelector:] (in DVTFoundation)
  8  0x000000011166057d -[PBXProject _projectReferences] (in DevToolsCore)
  9  0x000000011164912a -[PBXArchivingBinding writeValueForObject:toPListArchiver:] (in DevToolsCore)
 10  0x0000000111648158 -[PBXObject _archiveValuesForArchiveMask:toPListArchiver:] (in DevToolsCore)
 11  0x0000000111672997 -[PBXPListArchiver _archiveObject:asWeakReference:] (in DevToolsCore)
 12  0x00000001116734e6 -[PBXPListArchiver initWithRootObject:delegate:role:] (in DevToolsCore)
 13  0x0000000111650018 -[PBXProject writeToFile:projectFile:userFile:outResultNotification:] (in DevToolsCore)
 14  0x00000001116505a4 -[PBXProject _writeToFileSystemProjectFile:userFile:checkNeedsRevert:] (in DevToolsCore)
 15  0x0000000111650655 -[PBXProject writeToFileSystemProjectFile:userFile:checkNeedsRevert:] (in DevToolsCore)
 16  0x00000001117ee0bb -[Xcode3Project writeToFilePath:forceWrite:error:] (in DevToolsCore)
 17  0x000000010e68cf2d -[IDEContainer _saveContainerForAction:error:] (in IDEFoundation)
 18  0x00007fff920caf64 __NSFireTimer (in Foundation)
 19  0x00007fff9524dc24 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (in CoreFoundation)
 20  0x00007fff9524d776 __CFRunLoopDoTimer (in CoreFoundation)
 21  0x00007fff9522e001 __CFRunLoopRun (in CoreFoundation)
 22  0x00007fff9522d676 CFRunLoopRunSpecific (in CoreFoundation)
 23  0x00007fff965d331f RunCurrentEventLoopInMode (in HIToolbox)
 24  0x00007fff965da51b ReceiveNextEventCommon (in HIToolbox)
 25  0x00007fff965da456 BlockUntilNextEventMatchingListInMode (in HIToolbox)
 26  0x00007fff91411f5d _DPSNextEvent (in AppKit)
 27  0x00007fff91411861 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
 28  0x00007fff9140e19d -[NSApplication run] (in AppKit)
 29  0x00007fff9168cb88 NSApplicationMain (in AppKit)
 30  0x000000010df8aeec (in Xcode)

Some Additional Informations i found:

I tried this on a different computer - same effect. But, and this might be important: It only occurs after I do a real iPhone build. If i do a build for the simulator - everything works just fine and no crashes occur. As soon as I did a 'real' iOS build (debug or release) - it will crash if I do any project changes.

Manuel
  • 73
  • 1
  • 1
  • 6
  • How are you adding the files or groups? Dragging in, or using a menu command? Have you tried checking whether your project settings can be upgraded? – Scott Corscadden Apr 06 '12 at 10:55
  • Hello. My Project Settings are up to date. Both dragging in and using the menu (File - new just as much as using the Context menu) crashes the Application. Really frustrating :( – Manuel Apr 10 '12 at 13:42
  • Can you share a copy/paste of the crash report? Ie, the apple stack trace? Sometimes it can point to something that can be altered (although so far it does sound like an Apple bug worth reporting to them). – Scott Corscadden Apr 10 '12 at 14:13
  • i added it below since it's too long to post it as comment. Btw. - I just found out.. even changing the Project Version number has the same effect - If i do it without a clean - XCode will crash. – Manuel Apr 11 '12 at 14:54

1 Answers1

1

Ok - that does help a bit more. It appears to be how you have your targets set up. Note that version number, and the Bundle Identifier and all those "iOS Application Target" values don't get stored in the project.pbxproj file, but rather get written to the "MyApp-Info.plist" file. I'd check that file exists and correlates correctly to the value set in the INFOPLIST_FILE build setting for that target.

I'd also check that the main project file itself is "Project Format" is set to "XCode 3.2-compatible", not 3.1-compatible.

Scott Corscadden
  • 2,831
  • 1
  • 25
  • 43
  • The project has a couple of Targets. I checked all the entries and the corresponding Info.plist files and they all exist and are correct. Actually they have to be, otherwise I could not build the target - which works just fine. The project is set to XCode 3.2-compatible as well. Another thing i found out - doing a "Archive" (Release) of the build does not have the same effect. Only the debug builds will cause these crashes. Oh and: I do have set the project version in my Project Properties - This is to have the same project version in all my targets. – Manuel Apr 11 '12 at 15:59
  • Flummoxed. I was hoping some part of the XCode exception chain would show what is going on. Hail Mary options I'd try now, were I you (in parallel): 1) open bug with Apple, 2) Create brand new project that mimics targets and such like you already have, and try copying in the files and seeing whether it crashes, if it doesn't, see what differences exist b/w the two project sets 3) some probably unhelpful cursing, 4) check any and all related issues here on SO for similar things to try. Sorry I couldn't help more. – Scott Corscadden Apr 11 '12 at 23:43
  • Hey Scott. I added some new Informations i got about this issue. Maybe they can help? – Manuel Apr 20 '12 at 08:33
  • Have you opened a bug with Apple yet? The key line in your exception chain appears to be `[XCProjectReferenceInfo _synchronizeWithReferencedProjectIfNeeded]` - I think you have something in your target (or info settings) specifically causing this issue, perhaps further specified by the configuration file used for devices. Also look at Development vs. Distribution settings - you haven't specified in the original ticket which one you're doing there. – Scott Corscadden Apr 20 '12 at 11:48