Xcode failed to open with error: Scanning for plug-ins failed

xcode

I went to get onto Xcode, but when I tried to open it, I got this error:

Scanning for plug-ins failed.

enter image description here

I tried re-installing Xcode, but that did not solve the issue.

Why did this start happening all of a sudden? Did I accidentally mess-up privileges some how?

After following a suggestion, here is the list of permissions:

total 0
drwxr-xr-x  62 root  wheel  2108 Mar 15 19:21 .
drwxr-xr-x  17 root  wheel   578 Mar 24 15:02 ..
drwxr-xr-x   3 root  wheel   102 Mar 15 17:59 DVTAnalyticsClientPlugin.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar 15 17:59 DVTAnalyticsPlugin.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 25 20:24 DVTCorePlistStructDefs.dvtplugin
drwxr-xr-x   3 root  wheel   102 Feb 25 20:24 DVTServicesPlugIn.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 23 20:46 DVTiOSPlistStructDefs.dvtplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 DebuggerFoundation.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 DebuggerKit.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 DebuggerLLDB.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 DebuggerLLDBService.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 DebuggerUI.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 23:11 GPUDebuggerFoundation.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 23:11 GPUDebuggerGLSupport.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 23:11 GPUDebuggerKit.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 23:12 GPUDebuggerMTLSupport.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 23:11 GPURenderTargetEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 23:11 GPUTraceDebugger.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 23:11 GPUTraceDebuggerUI.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 HexEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 24 20:55 IBBuildSupport.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 24 20:55 IBCocoaBuildSupport.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  2 20:30 IBLanguageSupport.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEAppleScriptCore.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEAppleScriptEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 24 21:05 IDEContinuousIntegration.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 12 23:01 IDEDevkitRefactoring.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEDocViewer.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEGit.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:25 IDEIODebugGaugesCore.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:25 IDEIODebugGaugesUI.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 IDEInstrumentsService.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 24 20:56 IDEInterfaceBuilderCocoaIntegration.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 24 21:03 IDEInterfaceBuilderCocoaTouchIntegration.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 24 20:56 IDEInterfaceBuilderKit.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  2 20:29 IDELanguageSupportCore.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  2 20:30 IDELanguageSupportSimulator.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  2 20:30 IDELanguageSupportUI.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 IDEModelEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 IDEModelFoundation.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEPDFViewer.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar 15 17:59 IDEProductsUI.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:25 IDEQuickHelp.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEQuickLookEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDERTFEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 25 14:00 IDESceneKitEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDESourceEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 17:22 IDESpriteKitParticleEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEStandardExecutionActionsCore.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDEStandardExecutionActionsUI.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 IDESubversion.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 17:26 IDEWatchKit1SupportCore.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 10 17:26 IDEWatchKit1SupportUI.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 23 20:46 IDEiOSDebugger.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 23 20:46 IDEiOSProjectEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 23 20:46 IDEiOSSupportCore.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 23 20:46 IDEiPhoneSupport.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 PlistEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:24 ScriptingDefinitionEditor.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  2 20:30 Xcode3Core.ideplugin
drwxr-xr-x   3 root  wheel   102 Feb 23 20:43 Xcode3UI.ideplugin
drwxr-xr-x   3 root  wheel   102 Mar  8 17:23 iCloudSupport.ideplugin

And the permissions for the plugin folder:

drwxr-xr-x  62 root  wheel   2108 Mar 15 19:21 PlugIns

It looks correct to me, but I might be wrong.

Best Answer

It seems that at some point, plugins were moved to (Edit: it seems these are only the standard plugins and plugins added by the user are still in the old place. The standard plugins may have been there forever for all I know.)

/Applications/Xcode.app/Contents/PlugIns

I was able to reproduce this problem by changing permissions on one of the plugins residing in the above directory. (Edit: You get the same if you change permissions on the plugins in ~/Library/Developer/Shared/Xcode/Plug-ins/ but since you don't have any of those, it shouldn't matter.)

The permissions should be drwxr-xr-x

so in Terminal:

cd /Applications/Xcode.app/Contents/PlugIns
sudo chmod 755 *

should help, possibly with the -R option.

Note: If you have a very old Xcode installation that has been upgraded since the dawn of time, plugins may show up in (at least) the following locations:

~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
~/Library/Application Support/Xcode/Shared/Plug-ins
~/Library/Developer/Xcode/Plug-ins

I would delete them all and put new ones in the current standard location. (I just did)