Image/[email protected] pngcrush caught libpng error: Not a PNG file 类似错误的处理

***/Image/[email protected] pngcrush caught libpng error:  Not a PNG file..

应用在在模拟器上调试一点问题没有,但一放到真机上调试就出现copypngfile 的错误,编译器报错信息如下:

While reading /Users/avepoint/Desktop/**/**/Image/[email protected] pngcrush caught libpng error:

   Not a PNG file..

Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure


CopyPNGFile /Users/avepoint/Library/Developer/Xcode/DerivedData/**-eapmjmcpwpwpvcazuqcyashswpze/Build/Products/Debug-iphoneos/**.app/hsj.png **/Image/hsj.png

    cd /Users/avepoint/Desktop/Melon/XMPPWorking_realPhone/**

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng -compress /Users/avepoint/Desktop/**/**/Image/hsj.png /Users/avepoint/Library/Developer/Xcode/DerivedData/**-eapmjmcpwpwpvcazuqcyashswpze/Build/Products/Debug-iphoneos/**.app/hsj.png


错误信息提示说读取图片的时候没有找到这张图片,检查了一下图片路径,没有问题。

解决方案:

1.在build settings里把工程里的Compress PNG files设置为NO,问题解决,但这样设置以后,弄出来的ipa会很大。

2.mac中用preview(预览)打开出问题的png文件,然后重新导出png文件或者用photoshop把png图片保存为NOT INTERLACED(不交错)的,覆盖源文件。这样真机调试时就没有错误了

猜你喜欢

转载自blog.csdn.net/sundaysme/article/details/80470246
PNG