Search code examples
xcodexcode4

Xcode 4 project: utility to clean up pbxproj file?


I have an Xcode 4 project with 2 targets, one for iPhone and one for iPad. If I click on the iPad target and try to go to Build Settings Xcode 4 crashes:

Encountered multiple assertions. First assertion was: ASSERTION FAILURE in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-269/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/FileTypes/../PBXFileType.m:594 Details: filename should be a non-empty string, but it is nil

Obviously the pbxproj file has a bad reference in there somewhere -- likely caused by the many manual merges I've been forced to do by git. Is there some way to clean up the pbxproj file so it works correctly again or to tell which line is causing the problem?? I'd really really prefer not to have to recreate the project from scratch.


Solution

  • I tried gorbster's method with no success (though it has solved similar problems for me in the past).

    I went into my project.pbxproj file (inside the .xcodeproj package for the project) and found two lines that looked a little suspicious, both of the form:

    53A45F8F138FE6F40077017F /* (null) in Resources */ = {isa = PBXBuildFile; };
    

    I deleted the lines, and voilà: I can access my build settings for this target again.

    No idea how they got in there in the first place. I would guess something to do with a faulty merge under SVN.