Xcode error : Distill failed for unknown reasons

24,395

Solution 1

You might have migrated from a normal project to use an image.catalog. So you can definitely try to copy the bundle resource like launch images. It is so because migrating to an asset catalog for icons and launch images apparently doesn't always add itself to the target automatically.

You can find more on this here & here.

I hope that helps.

Solution 2

I found that my png was a psd file. I deleted the file and recreated a new png and everything was fine.

grgr

Solution 3

I had the same case as Karsten, one of the image was psd. I opened the file in Mac Preview app and tried to export and found that it was a PSD instead of .png enter image description here

Solution 4

For me, I used with Xcode beta but I didn't upgrade my MAC OSX beta to the latest version as Apple recommends.

enter image description here.

Solution 5

In my case it was a PSD file saved as PNG. You can search for wrong files by running following command in Terminal in your assets directory:

grep -rL "PNG" --include \*.png . 
Share:
24,395
Jun
Author by

Jun

Updated on July 09, 2022

Comments

  • Jun
    Jun almost 2 years

    Does anybody know why this error happens on Xcode 5?

    error

    Answer

    I had this problem when I accidentally renamed a .psd as a .png. Converting the image to an actual png instead of a Photoshop file fixed it for me.

  • Kevin R
    Kevin R about 9 years
    To clarify for future readers: second link points out that you might've saved the image as the wrong format (in my case: saving a PSD file with a .PNG extension).
  • Craig Grummitt
    Craig Grummitt over 8 years
    Same here, the extension was 'png' but I accidentally saved the file as psd type. Shame Xcode doesn't identify the specific file with the problem, takes some trial and error to narrow it down.
  • T Blank
    T Blank over 8 years
    Important Note: Preview and Xcode will treat your fake PNG just like a normal PNG. One of my tvOS app icon layers happened to be a PSD masquerading as a PNG, and it was way harder to track down than I thought it would be. So when testing your PNG assets, you must attempt to open them in Photoshop, not just in Preview. Your app will build and UIImage will work with your PSD that's been named *.png JUST FINE. I really wish it wouldn't.
  • Luis Artola
    Luis Artola over 8 years
    Saved me a lot of head scratching. Thumbs up for second link too. Thanks!
  • DardanM
    DardanM about 8 years
    @Harry Not sure what your point is. It still helped other people (including me)
  • Martin
    Martin over 7 years
    just arrived on a project, migrated to xcode 8, got this error, and looked at the 100 x 3 assets present in the xcasset file... what a good day.
  • RyanJM
    RyanJM over 5 years
    In Terminal, you can do file filename.png to check the type. I also used file */* in the root of the *.xcassets directory to check all the files in the group.
  • CrazyPro007
    CrazyPro007 over 4 years
    I have all image in png... still I am facing error in Xcode11GM-seed1
  • CEH
    CEH over 4 years
    It would be helpful if you provided some more specific info on how you updated the latest xcode. between which two versions did you do the update?
  • IgorGanapolsky
    IgorGanapolsky over 3 years
    What is image.catalog?
  • Odys
    Odys over 3 years
    Thanks for the response. On 10.15 beta 19A471t with xcode 11.3.1 11C505 the bug exists. Just adding one png icon to the assets it fails the build.