39

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/

PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56
Michael Ansell
  • 407
  • 1
  • 4
  • 6
  • 1
    You probably need to get more information about why it failed. This question suggests a way to get more information about the failed build process: https://stackoverflow.com/questions/30060898/xcode-how-to-see-build-command-and-log – GregHNZ Sep 25 '18 at 02:28
  • adding some more info can help. – kj007 Sep 25 '18 at 02:29
  • I added some info if you would like to take a look – Michael Ansell Oct 05 '18 at 01:20

35 Answers35

35

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

PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56
Jmf
  • 407
  • 3
  • 9
18

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

  • In Xcode 14.2, You must keep a AppIcon and an Image. Re-adding both did work. – ShakeMan Jan 11 '23 at 02:53
  • This worked for me. I had renamed my app icon to "appIcon". It's case sensitive. – Antonio Brandao Jun 16 '23 at 19:53
  • click the "+" button at the bottom of the list of image sets in the asset catalog, and choose "App Icons & Launch Images" > "New iOS App Icon" to add AppIcon.(name it empty file with "AppIcon" didn't worked for me) – Hajime Jul 19 '23 at 16:32
16

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
User123335511231
  • 11,654
  • 4
  • 18
  • 22
13

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:

markshiz
  • 2,501
  • 22
  • 28
7

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

Linus
  • 423
  • 5
  • 12
6

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.

L33MUR
  • 4,002
  • 2
  • 12
  • 27
  • In my case it's a sticker pack. I followed this to change the App Icons Source in 2 places to not use asset catalog. This cleared it up. Thanks for the tip! – Dan Feb 06 '22 at 17:13
3

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

Juan Fran Jimenez
  • 1,629
  • 15
  • 19
2

In Xcode 10 Go to Product>Clean Build Folder

or

User Short cut as Shift+Command+K

After that make run it will work, it worked in my case.

Ananta Prasad
  • 3,655
  • 3
  • 23
  • 35
2

In my case, the .xcassets file's target membership was unchecked for some reason. All I had to do was re enable it for the target I was working on and it fixed the error.

2

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.

Sungwook Kim
  • 356
  • 1
  • 3
  • 11
2

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!

2

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."

Berry
  • 1,719
  • 2
  • 11
  • 15
1

I also had the same issue on Xcode 10. Tried everything but nothing worked. Just out of curiosity tried compiling my project in Xcode 9.4 and it failed again but this time it gave me a valid error. In my case it was because of no images in the launch image assets and the project being an old one had launch images instead of launch screen storyboard. Would recommend to try the project in lower Xcodes of available.

PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56
Prasad Parab
  • 381
  • 1
  • 12
1

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

Khashayar
  • 357
  • 3
  • 12
1

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

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

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.

Danny Parker
  • 1,713
  • 18
  • 30
0

Did you copy an assets folder into your Xcode project? If so you might have 2 and need to erase the old one.

0

I also faced same issue and I follow these steps :

1- Remove Reference Assets.xcassets folder.

2- Clean (both CMD+SHIFT+K and CMD+ALT+SHIFT+K).

3- Build (CMD+B).

4- Add your Assets.xcassets folder.

5- Follow steps 2 & 3 again.

Abhishek Mishra
  • 1,625
  • 16
  • 32
0

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.

Pedro Paulo Amorim
  • 1,838
  • 2
  • 27
  • 50
0

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

BASIL BABY
  • 73
  • 2
0

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

dustinrwh
  • 888
  • 1
  • 14
  • 16
0

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

snowpeak
  • 797
  • 9
  • 25
0

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

0

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.

igitgor
  • 66
  • 4
0

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

Working for me.

water_ak47
  • 1,174
  • 12
  • 9
0

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.

dorsz
  • 905
  • 10
  • 20
0

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 */

  • Remember to review the existing answers before contributing a new answer. In this case, this was already suggested with additional details in [an answer by @Vladimir Kuzomenskyi](https://stackoverflow.com/a/59002110/3025856) two years ago. – Jeremy Caney Nov 07 '21 at 21:14
0

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.

vanenshi
  • 65
  • 2
  • 11
0

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

Deepak Ghadi
  • 163
  • 2
  • 5
0

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.

Mitemmetim
  • 520
  • 3
  • 12
0

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.

revati.at
  • 43
  • 5
0

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.

mathematics-and-caffeine
  • 1,664
  • 2
  • 15
  • 19
0

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

swiftyboi
  • 2,965
  • 4
  • 25
  • 52
0

For anyone coming across this today.

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

Ian Hoyos
  • 95
  • 1
  • 2
  • 8
0

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

Elik
  • 1