2

Everything is fine when building and running my app on device. The problem is at the end of archiving xcode always gives this error. Can you help me debug this error at least? Because every time it takes me 20 minutes to see if it fails again.

enter image description here

enter image description here

Debug info obtained: This error is thrown when I add some compressed images to the asset catalog. When I remove the compressed ones and add original uncompressed images, error is not thrown.

Murat Yasar
  • 994
  • 9
  • 24
  • I think you've answered your own question: "When I remove the compressed ones and add original uncompressed images, error is not thrown." . Doesn't that fix your issue? Clearly there is a compatibility issue with your "compressed images" and the assets catalogue – EarlGrey Feb 25 '20 at 21:07
  • Yes I can solve the problem that way but it is too time consuming to find the problematic images. I do not also want to remove compression from all images in the asset catalog. From this error message, is there a way to find the problematic image in the assets catalog? – Murat Yasar Feb 26 '20 at 06:08

1 Answers1

0

How are you compressing your images?

This link states that a similar error is thrown when you try to establish relationships between separate objects in core data. I think asset catalogs must use core data under the hood. My guess is whatever you're doing to compress and reapply the images is somehow adding metadata artifacts to your asset item that appear as relationships to other assets or objects to Xcode, which is not allowed. I'm not saying that based on experience, just reading your error.

If you think the new compressed image is fine and shouldn't have any weirdness, try deleting the item in the asset catalog and making a new asset with the same key/name, and then add your compressed images in. Asset catalogs items sometimes hold onto weird metadata.

Also, 20 minutes is a long compile time even on large projects, if you think you can recreate the bug in a fresh project, it would be much faster to test. Just make a new one with a couple image views, put your old images in first, then attempt to rerun there. You should be able to copy the asset catalog contents from one project to the next if you get it working there.

Edit: Also are there images being used directly in xibs or storyboard files? It seems like some of the meta data the compiler is coughing up could be related to xib files. I'm not too familiar with the stuff that came out of the compiler in your post, but you should check that your interface builder files still load correctly after the asset change.