CompileAssetCatalogVariant failed with nonzero exit code.

I'm running in a very very very weird error. I have a large asset catalog, consisting of about 2700 assets for 1.19GB of size.

I can successfully build and run my project with both release and debug scheme, when a real device or simulator is selected. However, whenever I select Any iOS device (arm64), about 80ish seconds in the build process, the building fails with the following output:

CoreUI: Error: unable to add asset to store
*** Terminating app due to uncaught exception 'IBPlatformToolFailureException', reason: 'The tool closed the connection (AssetCatalogSimulatorAgent)

What I tried and failed:

  • Cleaning DerivedData and restarting PC
  • Building the same project on three different devices, each with a different version of XCode. All failed.
  • running sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
  • Scanning for duplicate image files, found none.
  • Scanning for duplicate .imageset folders in different folders, found none.
  • Scanning for images that declared a different format than theirs, eg .webp renamed as .png, and found none.
  • Creating an empty Hello World project, and just adding my asset catalog. Build fails for Any iOS device, succeeds for simulator or physical device.
  • Uninstalling and reinstalling XCode command line tools.
  • Manually compiling via actools.
  • Changed "Embed Assets Pack in Product Bundle" from No to Yes.
  • I don't have any .svg file in my assets.

What I tried and failed but gives more insight:

Now the only thing that I was able to come up with was deleting folders to narrow down where the problem was. So I found that there is a 700MB folder called T, containing T1, T2, ..., T6. Eventually managed to narrow down even more to T3, T4, T6.

I created a distinct .xcassets catalog for each subfolder and tried to compile individually with actools, along with assets.xcassets (the main one). Here's the thing:

  • T3.xcassets + assets.xcassets compiles
  • T4.xcassets + assets.xcassets compiles
  • T6.xcassets + assets.xcassets compiles
  • T3.xcassets + T4.xcassets + assets.xcassets compiles.
  • T3.xcassets + T6.xcassets + assets.xcassets compiles.
  • T4.xcassets + T6.xcassets + assets.xcassets compiles.
  • T3.xcassets + T4.xcassets + T6.xcassets + assets.xcassets crashes with CoreUI: Error: unable to add asset to store.

I've been stuck for days now and can't deploy my finished app I worked on for the last three years because of this.

By further investigation it looks like hitting >800MB in size, even split across multiple .xcassets files, immediately triggers the error. Though, I couldn't find anything mentioning an hard limit on assets file size, only thing I could find was <=4GB cap on bundle size, which I don't even remotely hit.

It would be helpful if you could create a bug report with a test Xcode project attached. I'm guessing that if you include your complete asset catalog with the standard Xcode template project, this will reproduce, and if so, that reproducible project is very helpful to us. Please also list the Xcode versions where this worked for you in the past, and when it stopped working — are you on a version of Xcode 16 that cannot compile your assets, or Xcode 26?

Once that report is on file, please post the FB number here for reference.

— Ed Ford,  DTS Engineer

@DTS Engineer creating an empty project and copy/pasting the assets catalog does indeed reproduce the issue, the problem is that such catalog contains over 3k files total and its size is around 1.2GB, I don't think one can attach samples that large.

Of course in that 1.2GB there are assets that do not contribute to the issue, and I'm trying to slowly find a minimal set of assets that causes the issue to appear. Apple Support seems to require at most 50MB which is basically impossible for the scope of the project.

The issue appears with every version of XCode, it just fails with this error when building with Archive scheme, but runs and builds fine if a simulator or physical device is selected.

@DTS Engineer

This is the whole error by the way:

CoreUI: Error: unable to add asset to store
*** Terminating app due to uncaught exception 'IBPlatformToolFailureException', reason: 'The tool closed the connection (AssetCatalogSimulatorAgent)

Last command:
_ON_QUEUE_sendMessage:toChannelReturningError:during:

Backtrace of last command:
  0   -[IBAbstractPlatformToolProxy _ON_QUEUE_sendMessage:toChannelReturningError:during:] (in IDEInterfaceBuilderKit)
  1   __74-[IBAbstractPlatformToolProxy sendMessage:toChannelReturningError:during:]_block_invoke (in IDEInterfaceBuilderKit)
  2   _dispatch_client_callout (in libdispatch.dylib)
  3   _dispatch_lane_barrier_sync_invoke_and_complete (in libdispatch.dylib)
  4   DVTDispatchSync (in DVTFoundation)
  5   -[IBAbstractPlatformToolProxy sendMessage:toChannelReturningError:during:] (in IDEInterfaceBuilderKit)
  6   -[AssetCatalogRemoteAgentProxy compileItemsWithCatalogRelativeIdentifierPaths:tagSolutionSpace:andStickerPacksWithCatalogRelativeIdentifierPaths:options:] (in IDEInterfaceBuilderCocoaTouchIntegration)
  7   -[IBICSimulatorToolCARCompiler compileCARItems:tagSolutionSpace:options:queue:completionHandler:] (in AssetCatalogCocoaTouchKit)
  8   -[IBICAbstractPlatformAdapter compileCARItems:tagSolutionSpace:options:queue:completionHandler:] (in AssetCatalogFoundation)
  9   __84-[IBICAbstractPlatformAdapter compileSelectedItems:options:queue:completionHandler:]_block_invoke (in AssetCatalogFoundation)
 10   __93-[IBICAbstractPlatformAdapter compileStandaloneCatalogItems:options:queue:completionHandler:]_block_invoke (in AssetCatalogFoundation)
 11   __DVT_CALLING_CLIENT_BLOCK__ (in DVTFoundation)
 12   __DVTDispatchAsync_block_invoke (in DVTFoundation)
 13   _dispatch_call_block_and_release (in libdispatch.dylib)
 14   _dispatch_client_callout (in libdispatch.dylib)
 15   _dispatch_main_queue_drain.cold.5 (in libdispatch.dylib)
 16   _dispatch_main_queue_drain (in libdispatch.dylib)
 17   _dispatch_main_queue_callback_4CF (in libdispatch.dylib)
 18   __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ (in CoreFoundation)
 19   __CFRunLoopRun (in CoreFoundation)
 20   CFRunLoopRunSpecific (in CoreFoundation)
 21   -[NSRunLoop(NSRunLoop) runMode:beforeDate:] (in Foundation)
 22   -[NSRunLoop(DVTNSRunLoopAdditions) dvt_spinRunLoopInMode:whileQueue:executesAsynchronously:] (in DVTFoundation)
 23   -[NSRunLoop(DVTNSRunLoopAdditions) dvt_spinRunLoopInMode:whileBlockExecutesConcurrently:] (in DVTFoundation)
 24   -[NSRunLoop(DVTNSRunLoopAdditions) dvt_spinRunLoopInMode:waitingForSemaphore:] (in DVTFoundation)
 25   -[IBCLIImageCatalogToolPersona compileCatalogCollection:withPlatformAdapter:arguments:outputDictionary:] (in ibtoold)
 26   -[IBCLIImageCatalogToolPersona invokeArguments:outputDictionary:] (in ibtoold)
 27   -[IBCLIImageCatalogToolPersona runSingleInvocation:outputtingToFileHandle:andVerifyingEnvironment:] (in ibtoold)
 28   IBCLIServerRunSingleInvocation (in ibtoold)
 29   __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke_2 (in ibtoold)
 30   __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke (in ibtoold)
 31   -[IBCLIErrorForwarder forwardErrorOutputToDescriptor:whileInvokingBlock:] (in ibtoold)
 32   IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess (in ibtoold)
 33   main (in ibtoold)
 34   start (in dyld)


Execution Context:
<IBSimulatorToolCoreSimulatorCLIExecutionContext: 0x6000023dbea0 busyCount=0, Idle for 0.0 secs, lifeTime=63.4 secs>, device=IBSimDeviceTypeiPad3x (ACD2DA5F-C94B-40B4-99A8-741B47BDDF57, iOS 18.5, Shutdown), idiom=<IBIPhoneIdiom: 0x6000031fc370>

'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000018e3bfae0 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000018de82b90 objc_exception_throw + 88
	2   CoreFoundation                      0x000000018e3e4154 _CFBundleGetValueForInfoKey + 0
	3   IDEInterfaceBuilderKit              0x0000000104c9c97c -[IBAbstractPlatformToolProxy _errorByAddingAdditionalCrashInformationToError:orRaiseIfNeededOnFailure:shouldRaiseOnFailures:waitForCrashLog:] + 1204
	4   IDEInterfaceBuilderKit              0x0000000104c9c4a0 -[IBAbstractPlatformToolProxy errorByAddingAdditionalCrashInformationToError:orRaiseIfNeededOnFailure:] + 80
	5   IDEInterfaceBuilderKit              0x0000000104c9e0c0 -[IBAbstractPlatformToolProxy _ON_QUEUE_sendMessage:toChannelReturningError:during:] + 188
	6   IDEInterfaceBuilderKit              0x0000000104c9dfc8 __74-[IBAbstractPlatformToolProxy sendMessage:toChannelReturningError:during:]_block_invoke + 32
	7   libdispatch.dylib                   0x000000018e0c585c _dispatch_client_callout + 16
	8   libdispatch.dylib                   0x000000018e0bb7a8 _dispatch_lane_barrier_sync_invoke_and_complete + 56
	9   DVTFoundation                       0x00000001039820d4 DVTDispatchSync + 148
	10  IDEInterfaceBuilderKit              0x0000000104c9df14 -[IBAbstractPlatformToolProxy sendMessage:toChannelReturningError:during:] + 196
	11  IDEInterfaceBuilderCocoaTouchIntegr 0x000000011a029978 -[AssetCatalogRemoteAgentProxy compileItemsWithCatalogRelativeIdentifierPaths:tagSolutionSpace:andStickerPacksWithCatalogRelativeIdentifierPaths:options:] + 208
	12  AssetCatalogCocoaTouchKit           0x000000010e220854 -[IBICSimulatorToolCARCompiler compileCARItems:tagSolutionSpace:options:queue:completionHandler:] + 924
	13  AssetCatalogFoundation              0x00000001036cdee0 -[IBICAbstractPlatformAdapter compileCARItems:tagSolutionSpace:options:queue:completionHandler:] + 408
	14  AssetCatalogFoundation              0x00000001036cd360 __84-[IBICAbstractPlatformAdapter compileSelectedItems:options:queue:completionHandler:]_block_invoke + 188
	15  AssetCatalogFoundation              0x00000001036d195c __93-[IBICAbstractPlatformAdapter compileStandaloneCatalogItems:options:queue:completionHandler:]_block_invoke + 24
[...]
	35  ibtoold                             0x0000000102cdaf
libc++abi: terminating due to uncaught exception of type NSException
Command CompileAssetCatalogVariant failed with a nonzero exit code
CompileAssetCatalogVariant failed with nonzero exit code.
 
 
Q