While reading xxx.png pngcrush caught libpng error: Not a PNG file..

While reading /XXX/XXX/XXX/img1.png pngcrush caught libpng error:   Not a PNG filCould not find file: /Users/XXX/Library/Developer/Xcode/DerivedData/CookBookDemo-cnttcobrbmvbddeiesgsxnfwihfe/Build/Products/Debug-iphoneos/CookBookDemo.app/img1.pngCommand /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

原因:引入的png图片内部编码不符合真正的png格式。(就是把jpg图片修改了一下后缀名)。

解决方法:用真正的png图片。
原文地址:https://www.cnblogs.com/hw140430/p/3785280.html