Michael Ansell
Michael Ansell

Reputation: 467

Command CompileAssetCatalog failed with a nonzero exit code

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/

Upvotes: 45

Views: 66202

Answers (30)

Clintm
Clintm

Reputation: 4877

As per this thread on Apple forums: https://forums.developer.apple.com/forums/thread/747920

There's a problem in Xcode 15.3 not compiling svg assets. Downgrading to Xcode 15.2 solved the problem.

Upvotes: 1

Marc Isikoff
Marc Isikoff

Reputation: 11

If you have appIcon or appicon with 3 image sets (1x,2x,3x) just delete that. Go to Assets in Xcode and in the left panel where assets are at the bottom is a + and -. Use the '+' and pick ios/ios app icon and it will create a single set for a 1024 x 1024 image - I resized mine from 512 x 512 to 1024 x 1024 and bob's yer uncle!

Upvotes: 1

Elik
Elik

Reputation: 31

Also, the presence of an "AppIcon" file is optional. You just need to make sure that the name of the icon file in the project file and the real name match

Project file

Assets

Upvotes: 3

Ian Hoyos
Ian Hoyos

Reputation: 115

For anyone coming across this today.

Make sure your AppIcon image is correctly sized to 1024x1024px, otherwise it will also produce this error.

Upvotes: 0

swiftyboi
swiftyboi

Reputation: 3221

If you have image files in LFS, be sure to pull them.

Upvotes: 0

mathematics-and-caffeine
mathematics-and-caffeine

Reputation: 2197

None of the suggestions worked for me so I ended up downloading the zipped project folder from the last GitHub push, and simply replaced the asset folder with the asset folder from the downloaded folder. This fixed it.

Upvotes: 0

revati.at
revati.at

Reputation: 55

I had the same issue and my problem was that my assets.xcassets file was linked to another project which was moved on filesystem. For solution I just copied my assets.xcassets folder to the actual project and added it.

Upvotes: 0

Berry
Berry

Reputation: 1749

Here's what I did to figure out what was actually failing when I started getting this error:

  1. make sure the Xcode command line tools were installed

  2. in my project directory, run:

    xcodebuild -verbose > build.out 2>&1

  3. examine build.out

In there I found this line:

: error: The stickers icon set or app icon set named "AppIcon" did not have any applicable content.

I fixed the AppIcon asset and my project started building successfully again.

Other people may have different errors, but at least this gives some more information than "something bad happened."

Upvotes: 2

markshiz
markshiz

Reputation: 2561

If you have or have had multiple versions of Xcode open, you may need to reboot the CoreSimulatorService, an evil background service that somehow remains online and available to many versions of Xcode despite it being compatible with only one version, and clean up the associated files.

In my case, there seems to be a compatibility issue between Xcode 13.2.1, 13.4.1 and 14-beta. After hours of searching, the following commands finally pulled me out of a pit of reboots, reinstalls, and deleting DerivedData.

# Make sure the correct version of Xcode is selected
xcode-select -p

# Clear out conflicting devices here, if any
rm -rf ~/Library/Developer/CoreSimulator/Devices

# Trigger the Simulator service to restart
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

# Clean up Xcode simulator references
xcrun simctl delete unavailable

If this alone doesn't work, there could also be an issue where CoreSimulatorService was installed by a conflicting version of Xcode and even restarting will not remedy your situation. You can see that this daemon is run from a global directory on your system, which is initialized by Xcode in the install scripts on first launch:

$ ps aux | grep CoreSimulator
user    13668   0.0  0.0 408883856  17760   ??  S     9:52AM   0:00.05 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/SimulatorTrampoline.xpc/Contents/MacOS/SimulatorTrampoline
user    13665   0.0  0.0 408765760  25248   ??  S     9:52AM   0:03.20 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc/Contents/MacOS/com.apple.CoreSimulator.CoreSimulatorService
root              2161   0.0  0.0 408612544  10432   ??  Ss    9:29AM   0:06.33 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Resources/bin/simdiskimaged
user     2158   0.0  0.0 408574240   7088   ??  S     9:29AM   0:00.07 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/SimLaunchHost.arm64.xpc/Contents/MacOS/SimLaunchHost.arm64

This is a little more involved, because it requires that the /Library/Developer/ directory be cleaned out before Xcode restarted to replace the broken version.

rm -rf /Library/Developer/**

Note that your Terminal.app or whatever you are using for your shell will need full disk access in order to do this, under System Preferences > Security & Privacy > Full Disk Access > [Terminal.app]

The reinstall should launch after starting the desired version of Xcode, but you can also manually run the install pkg files inside to re-execute this install process /Application/<Xcode.app>/Contents/Resources/Packages/.

Other symptoms of this issue: Simulators not showing up in the Window > Devices and Simulators listing and simctl throwing errors and being unable to find base iOS SDKs similar to the following:

$ xcrun simctl list
...
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-15-5 --
    iPhone 8 (55A90310-8202-4A0D-968B-00F440D42210) (Shutdown) (unavailable, runtime profile not found)

See also:

Upvotes: 16

Mitemmetim
Mitemmetim

Reputation: 742

For me it was an issue with one specific image/SVG - I just deleted almost all of my pictures to see that the project then built and then narrowed it down to one specific image. I made some adaptions on the SVG and then the project built again.

Upvotes: 1

Deepak Ghadi
Deepak Ghadi

Reputation: 183

For White Label App(WLA), In my case, I was creating WLA from existing functional app, after doing necessary steps to add WLA, getting above error while building, then check in

Target -> Build Phases -> Copy bundle resources -> and here images.xcassets have 2 separate folder i.e. 1st that I have added images folder for that particular target and 2nd is already there, from which target I copied and made duplicate.

So 2nd I deleted and then app build successfully

Upvotes: 0

vanenshi
vanenshi

Reputation: 95

If you are having this problem on a react-native project, with Xcode version 13: you need to add your app icon to the Assets folder, instead of the Images folder.

Upvotes: 0

user2084373
user2084373

Reputation: 11

in Build settings, enable "Embed Asset Packs in Product Bundle". screenshot

Upvotes: 1

JRSoftworx
JRSoftworx

Reputation: 1

If you didn't provide an AppIcon it will produce the same error.

/* com.apple.actool.errors / : error: None of the input catalogs contained a matching stickers icon set or app icon set named "AppIcon". / com.apple.actool.compilation-results */

Upvotes: 0

dorsz
dorsz

Reputation: 945

My solution, after trying a lot of suggested fixes from above on XCode 10.1, was to run the project on XCode 10.0. Magically, it just worked.

Upvotes: 0

Juan Fran Jimenez
Juan Fran Jimenez

Reputation: 1659

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

Upvotes: 3

water_ak47
water_ak47

Reputation: 1306

My solution was to delete the images that were not used in Assets.xcassets.

Working for me.

Upvotes: 0

igitgor
igitgor

Reputation: 66

This error can appear when asset catalog take long time to compile. It is one more case I faced and rebuilding the project again fixed the issue in most cases.

Upvotes: 0

Khashayar
Khashayar

Reputation: 438

In my Assets folder, I have some images, one of which was corrupted. Having a corrupted file loaded in the Assets folder will also cause this error!

enter image description here

Upvotes: 2

Yessen Yermukhanbet
Yessen Yermukhanbet

Reputation: 105

Try to restart your Xcode, and Mac. Then, clean build the project itself(command+shift+B). Worked for me. Sometimes, Xcode acts weirdly, and just needs to be restarted. Good luck!

Upvotes: 2

Linus Karlsson
Linus Karlsson

Reputation: 546

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

Upvotes: 7

Giannis Chatziveroglou
Giannis Chatziveroglou

Reputation: 206

What worked for me was adding an AppIcon in the Assets. I had previously deleted the one that came with the project, but re-adding it solved the issue for me

Upvotes: 0

Danny Parker
Danny Parker

Reputation: 1773

Ensure that the command-line tools and all required components are installed for your version of Xcode as the asset compilation does use some of these tools, and may be using outdated ones depending on your setup.

I was hitting a CompileAssetCatalog error on our remote build machine after the Xcode 10.1 upgrade - but it worked on a separate machine locally. I hadn't run xcode on the remote machine so it had not prompted to install all the latest components, running xcode and installing the missing components resolved the issue for us.

Upvotes: 0

Vladimir Kuzomenskyi
Vladimir Kuzomenskyi

Reputation: 521

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

Upvotes: 23

snowpeak
snowpeak

Reputation: 867

This should be a temporary workaround, if you are in urgent, but build succeeded by changing simulator.

Upvotes: 0

dustinrwh
dustinrwh

Reputation: 926

I encountered this on Xcode 11 and nothing worked until I deleted and re-installed Xcode.

Upvotes: 0

BASIL BABY
BASIL BABY

Reputation: 73

Go to the Assets.xcassets in the xcode and resolve the error and warnings in it. In this CheerApp asset is not properly linked got to that asset in xcode and drag and drop in respective 1x,2x

Upvotes: 0

L33MUR
L33MUR

Reputation: 4058

I found the same error related to the Launch Images.

My solution:

In the main project settings go to:

  1. Tab: General
  2. Section: App Icons and Launch Images
  3. Option: Launch Images Source

Remove the link to the asset catalog, and clean the build folder with CMD+SHIFT+K.

Voilà!

You can link it later again.

Upvotes: 7

Sungwook Kim
Sungwook Kim

Reputation: 354

All of answers don't work for me. What solved and found by me is getting better Xcode like Xcode11 beta5 or Xcode10.3 stable and installing it and then Shift-Command-K to clean the project.

And recompiling the project with new Xcode version solved the problem.

Upvotes: 2

Pedro Paulo Amorim
Pedro Paulo Amorim

Reputation: 1949

If you are experiencing this issue on Xcode 10.3, Delete the folders iOS DeviceSupport, DerivedData and Archives from library/Developer/Xcode folder and restart your mac.

Upvotes: 0

Related Questions