While reading XXX pngcrush caught libpng error: N

错误一:
 

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。
 
方法二:如果不是因为图片格式 的山寨版造成的  那么就删除后重新导入一遍
 
 
错误二:

Not a PNG filCommand /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

 

两种解决方法 :

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

2.mac上的preview(预览)打开出问题的png文件,然后重新导出为png文件,问题解决。

 

案例三:

附上报错信息

这里写图片描述

原因是提示的png并不是ps到处的png,而是手动修改jpeg后缀名为png,在模拟器上不会报错,但在真机,不识别这种所谓的“png”图片。

解决方案:

用ps重新导出png就ok了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值