Search code examples
xcodexcode4

How to fix: Xcode cannot be opened because of a problem?


After installing Xcode 4.0.2, I get this error when I try to launch it by double-clicking on an existing project:

Dyld Error Message: Library not loaded: @rpath/DevToolsFoundation.framework/Versions/A/DevToolsFoundation Referenced from: /Developer/Developer/Applications/Xcode.app/Contents/MacOS/Xcode Reason: image not found

Launching Xcode via the dock and opening the project from inside Xcode works fine. Also note that doing a repair install of Xcode did not resolve the issue. I haven't tried completely uninstalling Xcode and installing from scratch, but I would prefer to avoid that as I have my IDE nicely customized the way I like it.

Update: I just tried a complete uninstall of Xcode via sudo Developer/Library/uninstall-devtools --mode=all then rebooted and reinstalled. Still having the same issue.


Solution

  • Before you reinstall, make sure your project file is set to open with the expected copy of Xcode 4. Select it in Finder, press Cmd-I, and make sure the Open With... popup is set to the right copy of Xcode 4.