Jun
Jun

Reputation: 3442

Xcode error : Distill failed for unknown reasons

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.

Upvotes: 51

Views: 27712

Answers (19)

Lokendra singh Chauhan
Lokendra singh Chauhan

Reputation: 161

I deleted the Assets.xcassets folder in my Runner folder of ios To be more specific

  1. Ios==>> Runner ==>> Assets.xcassets deleted.
  2. then paste previous Assets.xcassets file here Then it was working fine.

Upvotes: 2

MortyXiong
MortyXiong

Reputation: 31

I had the same error and it is because I forgot initializing Git LFS. So the png files are not pulled

Upvotes: 3

nathanwhy
nathanwhy

Reputation: 6144

In my case, there is a invalid png image in Assets.xcassets.

Upvotes: 1

solodon
solodon

Reputation: 545

If you hit this error, as a workaround, try removing all the images in you Images.xcassets from their placeholders and build the project again. Assuming the project builds without any images in place, which was the case for me, start re-adding images back one by one, starting from the bottom (App Store, iPad etc.) building project after each addition. This will help you isolate placeholders that cause the error.

In my case: the set of icons that comes with cocos2d-x project, the problem doesn't seem to be with a particular image, but with placeholder it is placed in. In particular, it seems to give an error on all placeholders whose name includes "iPhone". I can successfully build the project with all non-iPhone placeholders filled, but as soon as I move an image from say iPad placeholder to a compatible iPhone placeholder (e.g. iPad Notifications 20pt@2x to iPhone Notification 20pt@2x) the project fails with the above mentioned error.

I'm on the latest (as of right now) MacOS Catalina 10.15 Beta (19A487l) and the latest Xcode 11.3.1 (11C504), but I still hit this error, so the suggestions about to update to the latest won't necessarily work. The command line in both cases is:

/Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/me/Library/Developer/Xcode/DerivedData/MyProject-eiofgcnvwliyntcmqdepcocwffyk/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject-mobile.build/assetcatalog_dependencies --output-partial-info-plist /Users/me/Library/Developer/Xcode/DerivedData/MyProject-eiofgcnvwliyntcmqdepcocwffyk/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject-mobile.build/assetcatalog_generated_info.plist --app-icon AppIcon --enable-on-demand-resources YES --filter-for-device-model iPhone10,6 --filter-for-device-os-version 13.3.1 --sticker-pack-identifier-prefix com.example.app.ios.sticker-pack. --development-region English --target-device iphone --target-device ipad --minimum-deployment-target 12.1 --platform iphoneos --product-type com.apple.product-type.application --compile /Users/me/Library/Developer/Xcode/DerivedData/MyProject-eiofgcnvwliyntcmqdepcocwffyk/Build/Products/Debug-iphoneos/MyProject-mobile.app /Users/me/Projects/Cocos/MyProject/proj.ios_mac/ios/Images.xcassets

Upvotes: 1

Timofey Kuzmin
Timofey Kuzmin

Reputation: 55

In my case I just forgot to initialize Git LFS for my repo.

Upvotes: 4

Payam Khaninejad
Payam Khaninejad

Reputation: 7996

I faced this error on Xcode_11.1 and completely wasted my whole week. then I realize it was Xcode itself bug, I tried many of the above answers but no luck.

to make sure it's Xcode bug just simply empty the asset folder the try to build with empty folder if errors still exist then downgrade or upgrade to another version my working version was Xcode_10.2.1

Hope it helps

Upvotes: 0

glemoulant
glemoulant

Reputation: 527

My image names that contained "ç" or that end with "é" caused the problem. Renaiming it and cleaning the project did the trick! Odly this naming worked on xcode 10 but no more on 11.1

Upvotes: 0

Sonali Rana
Sonali Rana

Reputation: 1

After investing like 6-7 hours on this,I checked same project on MacOS Mojave - 10.14.6(18G103)and it was working fine but it was not working on MacOS Catalina Beta Version. After investigating, i updated the MacOS to the latest Catalina Beta Version and it was working fine.

Upvotes: -1

Zaid Pathan
Zaid Pathan

Reputation: 16820

Xcode 11: I just removed Assets.xcassets and re-added to target, and it worked.

Upvotes: 3

krzysztof
krzysztof

Reputation: 441

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 . 

Upvotes: 3

Gus
Gus

Reputation: 11

Update or ensure minimum version is: Mac OS CATALINA BETA 10.15 beta (19A536g) and Xcode Version 11.0 beta 5 (11M382q)

After talking with an apple engineer, the problem was solved by updating MAC OS and Xcode, specifically to these versions I assure that the problem was solve.

Upvotes: 1

evya
evya

Reputation: 3647

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.

Upvotes: 4

For me the solution was to do the following (given I had no .psd as .png, etc.).

Go to the General tab of the Target in Xcode project settings, roll down to the "App Icons and Launch Images" section, and change the value of "App Icons Source" from "AppIcon" to "Don't use asset catalogs"

Note: this way the project builds and deploys on iOS, and later you can change the AppIcon settings back, adding your custom AppIcon (with proper file-format and file-extension).

Upvotes: 3

Amr Angry
Amr Angry

Reputation: 3851

it happen for me with xcode 7.3 when i was replace an insert and image with the same name in the folder (in finder screen)

so i just rename remove the image form assets and insert it gain with a different name clean + build and it works fine

Upvotes: 0

naveed148
naveed148

Reputation: 548

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

Upvotes: 13

Joni
Joni

Reputation: 3069

In my case, one of the image asset is corrupted and caused this issue.

Corrupted image usually with 0 (zero) size. so, we can use terminal to find out which one:

find ./your_directory_path -size 0 -print

Upvotes: 3

Karsten
Karsten

Reputation: 1917

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

grgr

Upvotes: 49

MadNik
MadNik

Reputation: 7793

I was prompted this error and I inspect error logs.

PrefixIcons.xcassets/PrefixButtonBackground.imageset/PrefixButtonBackground.png
/* com.apple.actool.errors */
: error: Distill failed for unknown reasons.

The reason was.

I have mistakenly added same image for 1x and 2x sizes for above given image.

Might be helpful to someone.

Upvotes: 0

Balram Tiwari
Balram Tiwari

Reputation: 5667

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.

Upvotes: 10

Related Questions