Friday, September 25, 2020

Xcode 12.0 and ToolChain Error

I updated my Xcode two days ago. After the update, I got a warning error about ToolChain failure: 

/Library/Developer/Toolchains/swift-2.2-SNAPSHOT-2015-12-10-a.xctoolchain:1:1: failed to load toolchain: 'Version' parse error: Could not parse version component from: 'swift-2'

There is no further explanation about this error in Xcode. After Google search, I found one solution. It seems that it is caused by Xcode missing remove it when I did Xcode update.


As in the suggestion, the tool chain has to be removed from /Library/Developer/ToolChain/. In my case, there are two items in the direct:

$ ls
swift-2.2-SNAPSHOT-2015-12-10-a.xctoolchain
swift-latest.xctoolchain

The first one is a directry, and the second is a link to the directory. For safe case, I use Finder to the directory, and compress those two items first as Archive.zip. Then Remove them completely.

I have to quit Xcode and relaunch Xcode again to do clean build. This time warning error is gone.

My Update Xcode 12.0


The update process was painful. It toke long time to download. I got failure 2 twice.

I had Xcode update frustrating experience before. There was one time the updated Xcode version could not build my project. I had to rollback to old version from TimeMachine backup.

From that experience, I have been kept copy of previous Xcode to external disk first. Then I remove Xcode from Applications. In this way, this time I did clean installation of Xcode 12.0. Another reason is that I do not have enough space in my hard disk to do update. I had to remove old version to get more space.

This clean installation may missed the step to remove ToolChain.

Read More...