xcode 资产目录编译器错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20483713/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:01:48  来源:igfitidea点击:

Asset Catalog Compiler Error

xcodeios7

提问by ianM

I'm not sure what I did to get this error in Xcode 5:

我不确定在 Xcode 5 中我做了什么来得到这个错误:

"None of the input catalogs contained a matching app icon set named "AppIcon"".

“没有一个输入目录包含名为“AppIcon”的匹配应用程序图标集。

My app was building fine - then my machine locked up tighter than the arctic - don't know why - and now I get this error.

我的应用程序构建得很好 - 然后我的机器锁得比北极更紧 - 不知道为什么 - 现在我收到这个错误。

(There was an existing answer to this same question - but I couldn't quite understand it. Sorry)

(同一问题已有答案 - 但我不太明白。抱歉)

Thanks for any help.

谢谢你的帮助。

回答by Michael Enriquez

I had this problem when I accidentally saved 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 ianM

Ok, so I haven;t had an answer overnight yet - so I prodded around myself - went into the general tab - App Icons section - and clicked 'Use AppIcon' button instead of 'Don't use asset calalogues'.

好的,所以我一夜之间还没有得到答案 - 所以我在自己周围摸索 - 进入常规选项卡 - 应用程序图标部分 - 并单击“使用 AppIcon”按钮而不是“不要使用资产目录”。

That fixed it - compiler error disappeared.

解决了它 - 编译器错误消失了。

Not exactly sure what it all means frankly. More docs to plod through, I suppose.

不完全确定这一切意味着什么坦率地说。我想还有更多的文档可以通过。

Anyway hopefully this may help someone else.

无论如何,希望这可以帮助其他人。

Thanks.

谢谢。

回答by Dip

If you changed the deployment target to some other version. The dependencies will be changed. In my case i changed from iOS 6 to 7 by mistake. changing back made it error free.

如果您将部署目标更改为其他版本。依赖项将被更改。就我而言,我错误地从 iOS 6 更改为 7。改回来使它没有错误。

回答by JanB

I had this problem and I had accidentally deleted the asset catalog for my app icons. Fortunately, I had a backup version. To fix it, I went to the Images.xcassets folder within my project folder and copied the AppIcon.appiconset folder from my backup project - worked fine.

我遇到了这个问题,我不小心删除了我的应用程序图标的资产目录。幸运的是,我有一个备份版本。为了修复它,我转到了项目文件夹中的 Images.xcassets 文件夹,并从我的备份项目中复制了 AppIcon.appiconset 文件夹 - 工作正常。

回答by Naveed Ahmad

Simple Solution:

简单的解决方案:

I was stuck in this issue and after reading "@Michael Enriquez" post, I realized that this problem occurred due to wrong formatted image resource, I was worried how to check which file I saved incorrectly if I have so many image resources. So I just used a software named ImageOptimfrom AppStorewhich I normally use for reducing image sizes, so I draggedall the images to ImageOptimand I realized the wrong file, ImageOptimshowed a cross signon the wrong formatted image, then I changed that specific image to png and my problem is solved. I hope this solution will help you. Have a look at the snapshot below:

我被这个问题困住了,在阅读了“ @Michael Enriquez”的帖子后,我意识到这个问题是由于格式错误的图像资源造成的,我担心如果我有这么多图像资源,如何检查我保存的哪个文件不正确。所以我只是用了一个名为软件ImageOptimAppStore的,我通常使用以减少图像的大小,所以我拖着所有图像ImageOptim,我意识到了错误的文件,ImageOptim十字标志错误格式的图像,然后我改变了特定图像转换为 png,我的问题就解决了。我希望这个解决方案能帮助你。看看下面的快照:

enter image description here

在此处输入图片说明

回答by Patrick Lynch

Had the same problem and tried several solutions but in the end it was a bad image file as well. I finally identified the troublemaker by deleting all the images and then re-adding them one by one until it wouldn't compile anymore. When I tried to open that file in Photoshop it gave me the following error message:

遇到了同样的问题并尝试了多种解决方案,但最终它也是一个错误的图像文件。我最终通过删除所有图像,然后将它们一一重新添加,直到不再编译为止,从而确定了麻烦制造者。当我尝试在 Photoshop 中打开该文件时,它给了我以下错误消息:

"Could not complete your request because the file-format module cannot parse the file."

“无法完成您的请求,因为文件格式模块无法解析文件。”

回答by Vinayak Bevinakatti

I had imported all the images from a folder into images.xcassets at once then started getting build failed.I tried deleting one image set at a time and build (?b) until I get the project build properly and understood one image set causing issue. Then continued deleting one image from that image set and build (?b) until I get build succeeded and found the culprit!. Because a different format file had been renamed to PNG.

我已将文件夹中的所有图像一次导入到 images.xcassets 中,然后开始构建失败。我尝试一次删除一个图像集并构建(?b),直到我正确构建项目并理解导致问题的图像集. 然后继续从该图像集中删除一个图像并构建(?b),直到构建成功并找到罪魁祸首!. 因为不同的格式文件已重命名为 PNG。

回答by LAOMUSIC ARTS

I just had this amoying error and besides deleting a wrongly included .psd file I′ve also RMC over the .xcodeproject/Show Package Contents and deleted the .xcworkspace file.

我刚刚遇到了这个令人讨厌的错误,除了删除错误包含的 .psd 文件之外,我还在 .xcodeproject/Show Package Contents 上进行了 RMC 并删除了 .xcworkspace 文件。

Hope this help others too.

希望这对其他人也有帮助。

回答by Anshul

I had this error when I added multiple time AppIcon set in Images.xcassets. I found that selected AppIcon set in Target/General/App Icons and Launch Images/AppIcon is different than the Target/Build Setting/Asset Catalog Compiler-Option/Asset Catalog App Icon Set Name. So that make sure AppIcon/LaunchImage set name must be same.

当我在 Images.xcassets 中添加多次 AppIcon 集时出现此错误。我发现在 Target/General/App Icons 和 Launch Images/AppIcon 中设置的选定 AppIcon 与 Target/Build Setting/Asset Catalog Compiler-Option/Asset Catalog App Icon Set Name 不同。确保 AppIcon/LaunchImage 设置名称必须相同。

回答by Mark Weiser

For me the quickest fix was to (first copy and make sure you have a backup of images) delete all files within Images.xcassets. Then go to "Editor" on top menu and click "New Image Set" all the way to "New OS X Icon" below that just to be safe. After this copy n paste back the images with the empty "New etc." still in the folder.

对我来说,最快的解决方法是(首先复制并确保您有图像备份)删除 Images.xcassets 中的所有文件。然后转到顶部菜单上的“编辑器”,然后单击“新图像集”一直到下面的“新 OS X 图标”,以确保安全。在此复制之后,粘贴回带有空“新等”的图像。还在文件夹里。