Oh my good gravy!
Here’s the back story. I was working on a cleanly installed Mac after migrating user accounts onto it. My account is not the primary admin account (eg. UID 501). Xcode was installed with all the permissions set to that primary user, an account that never logs onto this Mac!
I have been having multiple issues trying to get Xcode to build on this Mac — my traveling Mac. I like to leave my bread and butter Mac at home and travel with an 11 inch MacBook Air. Most Mac’s are too big to be easily opened on an airplane, in Economy. I cannot afford to fly business class since the Indie-Apocalypse hit in 2014.
The owner permissions were all f’ed up, where Xcode does it’s build business. The last straw was the “Command CompileAssetCatalog” failure.
To fix this, change the permissions on the Xcode folder in your home Library (which all files should be all owed my login username.) Pro Tip: replace your username where you see mine — tmitra
Checking the ownership of this folder showed I was not the owner. I fixed the permissions on the Xcode directory here:
sudo chown -R tmitra ~/Library/Developer/Xcode
Build and Run.
FWIW I also had to fix permissions elsewhere:
Error: Failed to create temporary directory: /Library/Developer/Xcode/UserData/IB Support/Simulator Devices/
sudo chown -R tmitra ~/Library/Developer/CoreSimulator/Devices
“tmp” couldn’t be removed because you don’t have permission to access it
sudo chown tmitra /Users/tmitra/Library/Developer/Xcode/DerivedData
Pro Tip: Also check that you are building with the correct Xcode on your Mac. To check which is building:
To change the path:
xcode-select -s /Applications/[put your Xcode.app here]/Contents/Developer
Your mileage may vary.