Command CompileAssetCatalog failed with a nonzero exit code

34,336

Solution 1

I managed to resolve this by doing a "build clean", removing "DerivedData" folder and re-starting my Mac.

Solution 2

It seems that this occurs if you change one of the images opened from the Assets. Here are some solutions that worked:

  1. Run the app on a different simulator
  2. Clean (both CMD+SHIFT+K and CMD+ALT+SHIFT+K)
  3. Re-add the Assets into the project
  4. Restart Mac
  5. JOKE: Restart the electric power plant

Solution 3

Try removing and then re-adding some of the files you're using. That did it for me at least.

This seems to be a bug in the Xcode 10.1

Solution 4

Make sure that you have an AppIcon file in your assets. I had the same error because I did deleted that file.

enter image description here

Solution 5

I was downgrading Xcode from 12 to 10.1 to work on an old project. I had done this before successfully but after upgrading from Catalina to Big Sur it stopped working. I was getting errors about Storyboards and the Asset folder:

Command CompileAssetCatalog failed with a nonzero exit code Command

CompileStoryboard failed with a nonzero exit code

I tried everything above and beyond. And only managed to get it working by deleting this library (right click Xcode 10.1 app icon > "Show Package Content"):

Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib

Share:
34,336
Author by

Michael Ansell

Updated on January 14, 2022

Comments

  • Michael Ansell over 1 year

    Running Xcode 10 and can not seem to find much information on this error that occurs when building my project.

    Any ideas on how to fix this?

    Here is the last line before the error:

    Desktop/CheerApp!/CheerApp!/Assets.xcassets Command CompileAssetCatalog failed with a nonzero exit code –

    Expanded:

    CompileAssetCatalog /Users/michaelansell/Library/Developer/Xcode/DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm/Build/Products/Debug-iphonesimulator/CheerApp!.app /Users/michaelansell/Desktop/CheerApp!/CheerApp!/Assets.xcassets (in target: CheerApp!) cd /Users/michaelansell/Desktop/CheerApp! /Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/michaelansell/Library/Developer/Xcode/DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm/Build/Intermediates.noindex/CheerApp!.build/Debug-iphonesimulator/CheerApp!.build/assetcatalog_dependencies --output-partial-info-plist /Users/michaelansell/Library/Developer/Xcode/DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm/Build/Intermediates.noindex/CheerApp!.build/Debug-iphonesimulator/CheerApp!.build/assetcatalog_generated_info.plist --app-icon AppIcon --compress-pngs --enable-on-demand-resources YES --optimization space --filter-for-device-model iPhone11,2 --filter-for-device-os-version 12.0 --sticker-pack-identifier-prefix Mike.CheerApp-.sticker-pack. --target-device iphone --target-device ipad --minimum-deployment-target 11.4 --platform iphonesimulator --product-type com.apple.product-type.application --compile /Users/michaelansell/Library/Developer/Xcode/DerivedData/CheerApp!-ehbjnqaldsycfegiviymewkplqhm/Build/Products/Debug-iphonesimulator/