ios Xcode 错误:由于未知原因蒸馏失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20580968/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode error : Distill failed for unknown reasons
提问by Fury
Does anybody know why this error happens on Xcode5?
有人知道为什么在 Xcode5 上会发生这个错误吗?
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.
当我不小心将 .psd 重命名为 .png 时,我遇到了这个问题。将图像转换为实际的 png 而不是 Photoshop 文件为我修复了它。
采纳答案by Balram Tiwari
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.
您可能已经从普通项目迁移到使用 image.catalog。因此,您绝对可以尝试复制捆绑资源,例如启动图像。之所以如此,是因为迁移到图标和启动图像的资产目录显然并不总是自动添加到目标中。
You can find more on this here& here.
I hope that helps.
我希望这有帮助。
回答by Karsten
I found that my png was a psd file. I deleted the file and recreated a new png and everything was fine.
我发现我的 png 是一个 psd 文件。我删除了文件并重新创建了一个新的 png,一切都很好。
grgr
格格
回答by naveed148
回答by evya
回答by Joni
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:
损坏的图像通常为 0(零)大小。所以,我们可以使用终端来找出哪一个:
find ./your_directory_path -size 0 -print
找到 ./your_directory_path -size 0 -print
回答by Zaid Pathan
Xcode 11: I just removed Assets.xcassets
and re-added to target, and it worked.
Xcode 11:我刚刚删除Assets.xcassets
并重新添加到目标,它起作用了。
回答by solodon
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.
如果您遇到此错误,作为一种解决方法,请尝试从它们的占位符中删除您的 Images.xcassets 中的所有图像,然后重新构建项目。假设项目构建时没有任何图像,这就是我的情况,开始一个一个地重新添加图像,每次添加后从底部(App Store、iPad 等)构建项目开始。这将帮助您隔离导致错误的占位符。
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.
在我的情况下:cocos2d-x 项目附带的一组图标,问题似乎不在于特定图像,而是放置在占位符中。特别是,它似乎对所有占位符都给出了错误名称包括“iPhone”。我可以在填充所有非 iPhone 占位符的情况下成功构建项目,但是一旦我将图像从 iPad 占位符移动到兼容的 iPhone 占位符(例如 iPad 通知 20pt@2x 到 iPhone 通知 20pt@2x),项目就会失败上面提到的错误。
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:
我使用的是最新的(截至目前)MacOS Catalina 10.15 Beta (19A487l) 和最新的 Xcode 11.3.1 (11C504),但我仍然遇到此错误,因此有关更新到最新版本的建议不一定工作。两种情况下的命令行都是:
/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
/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-型号 iPhone10,6 --filter-for-device-os-version 13.3.1 --sticker-pack-identifier-prefix com.example.app.ios.sticker-pack。--development-region 英文 --target-device iphone --target-device ipad --minimum-deployment-target 12.
回答by Dániel László Kovács
For me the solution was to do the following (given I had no .psd as .png, etc.).
对我来说,解决方案是执行以下操作(假设我没有 .psd 作为 .png 等)。
Go to the General tabof the Targetin 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"
转至常规选项卡的目标在Xcode项目设置,滚倒在“应用程序图标和启动图像”部分,并改变“的价值应用程序图标源”,从“ APPICON”到“不使用资产目录”
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).
注意:通过这种方式,项目在 iOS 上构建和部署,稍后您可以更改 AppIcon 设置,添加您的自定义 AppIcon(具有正确的文件格式和文件扩展名)。
回答by nathanwhy
In my case, there is a invalid png image in Assets.xcassets.
就我而言,Assets.xcassets 中有一个无效的 png 图像。
回答by glemoulant
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
我的图像名称包含“?” 或者以“é”结尾的导致了问题。重新命名并清理项目就成功了!奇怪的是,这个命名适用于 xcode 10,但不适用于 11.1