Xcode 4.5 - CopyPNGFile 仍然存在。需要新的想法

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

Xcode 4.5 - CopyPNGFile persists. Need new ideas

iosxcodeios6ios-simulatorxcode4.5

提问by Matthew

I'm making an iPad app and it runs on the simulator, but fails when i try building it for the device.

我正在制作一个 iPad 应用程序,它在模拟器上运行,但是当我尝试为设备构建它时失败了。

the error is below:

错误如下:

enter image description here

在此处输入图片说明

These are the things i've tried to rectify this issue:

这些是我试图纠正这个问题的事情:

  • went through every PNG file with Photoshop and saved them again w/o the interlace
  • Deleted all the images in my Resources folder and added them again by dragging/dropping the images again
  • Deleted ALL PNG images (left the JPGs) and it works...when i add one PNG, Xcode throws a hissy fit.
  • Deleted the derivedData in my ~Library/Developer/Xcode
  • quit Xcode and tried again
  • restarted my computer and tried again.
  • 使用 Photoshop 浏览每个 PNG 文件,并在没有隔行扫描的情况下再次保存它们
  • 删除了我的资源文件夹中的所有图像,并通过再次拖放图像再次添加它们
  • 删除了所有 PNG 图像(留下了 JPG)并且它可以工作……当我添加一个 PNG 时,Xcode 发出嘶嘶声。
  • 删除了我的 ~Library/Developer/Xcode 中的衍生数据
  • 退出 Xcode 并重试
  • 重新启动我的电脑并再次尝试。

i tried checking about the paths, but i'm not sure. Any ideas would be great please.

我尝试检查路径,但我不确定。任何想法都会很棒。

Addendumi also want to add that Xcode is throwing errors against its own [email protected] and Default.png!

附录我还想补充一点,Xcode 正在针对它自己的 [email protected] 和 Default.png 抛出错误!

采纳答案by Daij-Djan

This has NOTHING to do with png files missing but with a dynamic library you are linking against which isnt available on ios

这与缺少 png 文件无关,但与您正在链接的动态库无关,该库在 ios 上不可用

回答by Androyal

In my case the error is resolved by going to

在我的情况下,错误是通过去解决的

Build Phases -> Copy Bundle Resources

构建阶段 -> 复制捆绑资源

and removed all the duplicated entries of lunch images DefaultXX.png

并删除了午餐图片 DefaultXX.png 的所有重复条目

回答by X Sham

You have to save your PNG files as NOT INTERLACED. For example, by using Photoshop, go to menu File->Save For Web and Devices. Unchecked the box of 'Interlaced' and save the file. Usually interlaced box is unchecked already. Hope that helps

您必须将 PNG 文件保存为 NOT INTERLACED。例如,通过使用 Photoshop,转到菜单 File->Save For Web and Devices。取消选中“隔行扫描”框并保存文件。通常已取消选中隔行扫描框。希望有帮助

回答by Chirila Vasile

Build Settings -> Search for Compress PNG Files and set to NO . This helped me

Build Settings -> Search for Compress PNG Files 并设置为 NO 。这帮助了我

回答by Matthew

Well, i figured it out. The error log was a bit misleading since it says "Reason: Image not Found" right before the red highlight.

嗯,我想通了。错误日志有点误导,因为它在红色突出显示之前说“原因:找不到图像”。

Turns out the "image" isn't the PNG or JPG, but the liberal.dylib as explicitly mentioned above. No idea how my perl library is gone...

原来“图像”不是 PNG 或 JPG,而是上面明确提到的liberty.dylib。不知道我的 perl 库是怎么消失的...

回答by jxdwinter

Check out this, this might be help you.Or delete bkg1.png from your project.

看看这个,这可能对你有帮助。或者从你的项目中删除 bkg1.png。

回答by perborin

The error can also occure if you save the file in an unexpected format of what it actually supposed to be. For instance, you save a *.png but with a .jpg encoding. Make sure that the file format is the one you actually want.

如果您以意外的格式保存文件,也可能会发生该错误。例如,您保存一个 *.png 但使用 .jpg 编码。确保文件格式是您真正想要的格式。

回答by codeburn

Just try deleting the .png extension for the files which are causing you the trouble. Don't know how, but worked for me!

只需尝试删除给您带来麻烦的文件的 .png 扩展名。不知道如何,但对我有用!

回答by Bob Spryn

For me this error was occurring when the png was listed in the copy bundle resourcesphase on the build phasestab. See https://stackoverflow.com/a/5659415/287403

对我来说,当 pngcopy bundle resourcesbuild phases选项卡上的阶段中列出时,会发生此错误。见https://stackoverflow.com/a/5659415/287403