xcode 压缩构建设置中缺少的 Png 文件

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

Compress Png Files missing from build settings

iosobjective-cxcodeswiftxcode7

提问by Swinny89

I am building an app which has quite a few images in, therefore I have crushed them all using ImageOptim to help decrease the size of my .IPA. How ever the size of my app has not changed at all.

我正在构建一个包含相当多图像的应用程序,因此我使用 ImageOptim 将它们全部粉碎以帮助减小我的 .IPA 的大小。我的应用程序的大小根本没有改变。

I have looked on their website and they say to turn off Compress Png Filesin the Build Settings under Packaging. However that option is not there. I have tried manually adding it into my project.pbxproj but it gets listed under the User Defined section and does not turn it off.

我查看了他们的网站,他们说要Compress Png Files在 Packaging 下的 Build Settings 中关闭。但是,该选项不存在。我尝试将它手动添加到我的 project.pbxproj 中,但它被列在“用户定义”部分下并且没有将其关闭。

Screenshot of Packaging in Build Settings

构建设置中打包的屏幕截图

I have also tried searching in the Build settings (My main target is selected).

我还尝试在构建设置中搜索(选择了我的主要目标)。

enter image description here

在此处输入图片说明

So my question is... how can I add Compress Png Filesinto my build settings?

所以我的问题是......我如何添加Compress Png Files到我的构建设置中?

回答by Arthur Gevorkyan

It might sound mind blowing, but please read it to the very end.

这听起来可能令人兴奋,但请阅读到最后。

  1. Try dragging and dropping a dummy png file to your project navigator, then select like "Add, Copy if Needed" and the option will appear in the Packaging section. But, I guess, this is not your case.
  2. It looks like you have all your png's contained in an asset catalog rather that just lying around. For that case, I guess, you might want to play around with this: enter image description here
  1. 尝试将一个虚拟 png 文件拖放到您的项目导航器中,然后选择“添加,如果需要复制”,该选项将出现在“打包”部分中。但是,我想,这不是你的情况。
  2. 看起来您的所有 png 都包含在资产目录中,而不仅仅是散布。对于这种情况,我想,你可能想玩这个: 在此处输入图片说明

回答by Nilesh

You need to Just Search in Build Setting pngAnd CopyPNG File - Packaging is Searched And The Section Have Option is Compress Png Fileis The Default value is YesYou will change value NOit Means your png Files is Compressed Bellow is the Screen Shot

您只需要在构建设置png和 CopyPNG 文件中搜索 - 搜索包装并且该部分有选项是Compress Png File默认值是Yes您将更改值NO这意味着您的 png 文件被压缩波纹管是屏幕截图

enter image description here

在此处输入图片说明

回答by jorjj

If you change the format of the file to png, the error shows up all the time for the assets when you try to use it. It's better to find the original png file or save the file as a png file with an image editor.

如果您将文件的格式更改为 png,则在您尝试使用资源时始终会显示错误。最好找到原始的png文件或用图像编辑器将文件另存为png文件。

回答by Ahsan

It looks like the path of the file has been removed or relocated you can remove it from here as well check the picture below: enter image description here

看起来文件的路径已被删除或重新定位,您可以从这里删除它,也可以查看下图: 在此处输入图片说明