16

I use FileMerge as the difftool tool for Git. Recently, I started receiving a weird error message:

Unable to load platform at path /Applications/Xcode.app/Contents/
   Developer/Platforms/iPhoneOS.platform

FileMerge still performs the diff just fine (although it takes a bit longer to load). Any idea what's causing this, and how to fix it?

eykanal
  • 23,724
  • 17
  • 75
  • 107

6 Answers6

4

I had exactly the same problem while using FileMerge as a diff tool for svnX. The following command solved my problem:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

That's all.

1

To expand on user3761183's answer, after a bit of googling I ran:

sudo plutil -convert xml1 /Applications/Xcode.app/Contents/Developer/Platforms/*.platform/Info.plist

That got rid of all the Unable to load platform at path /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform errors. I'm still getting errors about:

Couldn't load '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/Core Build System.xcspec'. Reason: Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character b at line 1" UserInfo={NSDebugDescription=Unexpected character b at line 1, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected ';' or '=' after key at line 1" UserInfo={NSDebugDescription=Unexpected ';' or '=' after key at line 1}}.

But I was getting them originally too, so if you aren't then the above command should solve your problems.

EDIT: removed comment about Install addtional required components that did nothing. Next guess is reinstalling XCode as Jonathan F suggests.

FWIW I tried sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/ already and that did nothing too.

jim
  • 885
  • 9
  • 16
0

This appears to be a problem with Mercurial, too: Unable to load platform at path

If you don't develop for iOS, you can just delete that folder. If you do, you'll have to re-install XCode. (Unless you can figure out how to re-install just that platform).

I'm thinking you're better off just re-installing XCode, as there are some other SO questions dealing with platform related problems (not this specifically, but similar in nature) that all seem to point to reinstalling XCode:

XCODE fail to load platform

and

Xcode won't open: "Mac OS X platform is missing"

....so start re-installing and go get a beer!

Community
  • 1
  • 1
Jonathan F
  • 1,995
  • 12
  • 18
0

for me, converting all *.platform/Info.plist from binary to xml1 fixed the problem. strange ...

user3761183
  • 241
  • 3
  • 3
  • 1
    Welcome to Stack Overflow! Please read ["How do I write a good answer?](http://stackoverflow.com/help/how-to-answer) – Scott Solmer Jun 20 '14 at 18:41
0

I use XCode for my $ git mergetool and have gotten similar errors. For me, it's been related to XCode's components/simulators and documents.

Go to XCode -> Preferences -> Downloads and make sure you have the latest components and documents.

I'm only here because I updated to XCode 7 and I'm getting similar errors because of Apple Watch documentation combined with my employer letting our dev license expire...

Jason Lydon
  • 6,536
  • 1
  • 30
  • 41
0

Regarding the problem highlighted by jim in his answer, related to the "Unexpected character b at line 1" error, I found that Core Build System.strings and Native Build System.strings files at the path specified by the error message i.e. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/ are in some sort of binary format. The parser doesn't expect this and complains about the character b of the word bplist opening the file. Maybe playing with plutil as in the "platform problem" which the OP was asking about can help. I simply substituted the two files with versions from a Xcode 6 dmg, where they are in ASCII format and the problem vanished

simonstar
  • 23
  • 1
  • 2