Command CompileAssetCatalog failed with a nonzero exit code

I keep getting the following error when trying to build my app:

2022-07-08 19:59:03.837 ibtoold[65032:257043] DEBUG: Added to environment: {

    TMPDIR = "/var/folders/n1/mn972l7d7t53rk8kghkt9b4h0000gp/T/61CA0AE1-7540-4D8C-94B2-3BF37B7EB31C";

}

/* com.apple.actool.errors */

: error: Failed to launch AssetCatalogSimulatorAgent via CoreSimulator spawn

    Failure Reason: Failed to spawn AssetCatalogSimulatorAgent on IBSimDeviceTypeiPad2x (3E230588-1FA3-45F9-AB2E-C02394631AA7, (null), Shutdown)

    Underlying Errors:

        Description: Invalid device: The specified device is not available for spawning processes.

This is happening with Xcode 13.4.1

This started after installing the Xcode 14 beta along side Xcode 13.4.1 (I never actually opened or used the beta before this started happening).

Things I've tried:

  1. deleting DerrivedData
  2. changing the DerrivedData directory
  3. uninstalling Xcode 13 and 14 beta, and only reinstalling Xcode 13.
  4. restarting my computer.

Anyone else see this?

Also a side note:

I can't seem to add iOS 15 simulators after this started happening. I wonder if its related.

EDIT: Upon further digging im seeing this error message in my CoreSimulator.log file:

Jul  8 20:06:10 bmifsud-mbp CoreSimulatorService[2918] <Notice>: Could not locate default .GlobalPreferences.plist for iOS 15.5 (15.5 - 19F70) - com.apple.CoreSimulator.SimRuntime.iOS-15-5

Is there any way to reset this preference?

Accepted Answer

I seem to have solved the issue.

  1. Purged Xcode from my machine again. Including all caches.
  2. Deleted the contents of the /Library/Developer folder
  3. restarted my machine
  4. installed command line tools with Xcode-select --install
  5. redownloaded Xcode

I think the PrivateFrameworks folder inside of /Library/Developer/ was the culprit. Its last modified time was when I installed Xcode 14 beta, not the last time I reinstalled Xcode 13.4.1

I imagine some of the stuff the simulator runtime relies on was corrupted.

take a peek at this twitter thread from an xcode engineer, They seem to be aware of xcode14b3 having big issues with xcode13.4.x and below. Looks like they have a workaround , as they made a back end change for now. but you have to open a certain pane in xcode 14 then you can go back to xcode 13.4.1 etc.

https://twitter.com/AnaCalinov/status/1545118596820439040

Hello, I have the same problem and I tried the solutions below.

I did:

  1. Remove Xcode with CleanMyMac Software
  2. Delete Developer folder with DevCleaner
  3. Look in the terminal that all files with "xcode" are not directly linked to the software itself
  4. Restart my mac
  5. Install the command line tools dmg not with the terminal "13.4" (because 13.4.1 does not exist)
  6. Reinstall xCode** via the App Store
  7. Create a new project, make a compilation directly, then redo one add data in the Assets

BUT ! the problem is still here... :(

Solved, solution n°2

  1. Delete xCode (you can use CleanMyMac)
  2. Delete the developer folder from Library/Developper
  3. Go here LINK download Xcode 13.2.1 (not 13.4.1)
  4. Install and "Voila" !

Solution found by DaveWoodX https://twitter.com/davewoodx/status/1544820336629358601

My solution is to put value "AppIcon" in the "App Icon" category, that's it.

Command CompileAssetCatalog failed with a nonzero exit code
 
 
Q