错误一:
 

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了

While reading XXX pngcrush caught libpng error: N的更多相关文章

  1. 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: ...

  2. pngcrush caught libpng error: Not a PNG file..

    今日真机测试遇到这样的奇葩问题: While reading XXX/XXX.png pngcrush caught libpng error: Not a PNG file.. 替换几次图片都没解决 ...

  3. pngcrush caught libpng error原因及解决方法

    报错信息: While reading /Users/zhangyanfeng/Desktop/程序/KeyBoardDemo/KeyBoardDemo/keyboard/KerboardResour ...

  4. Icon.png pngcrush caught libpng error:Read

    [问题处理]Icon.png pngcrush caught libpng error:Read Error 遇到问题 在项目Archive时,遇到 Icon.png pngcrush caught ...

  5. MySQL远程连接丢失问题解决方法Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0

    最近远程连接mysql总是提示 Lost connection 很明显这是连接初始化阶段就丢失了连接的错误 其实问题很简单,都是MySQL的配置文件默认没有为远程连接配置好,只需要更改下MySQL的配 ...

  6. iOS真机运行 Xcode报错(libpng error: CgBI: unhandled critical chunk)问题已解决;

    Cocos2d-x加载图片资源出现libpng error: CgBI: unhandled critical chunk Xcode7.3 设置Remove Text Metadata From P ...

  7. 虚拟机中MySQL连接问题:Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql

    环境:在VirtualBox中安装了Ubuntu虚拟机,网络使用了NAT模式,开启了端口转发. 局域网内其他计算机访问虚拟机中的MySQL Server出现两个问题: Lost connection ...

  8. AAPT: libpng error: Not a PNG file 问题解决

    导入项目到Android Studio的时候,Gradle Build失败了,报的错是 FAILURE: Build failed with an exception. Execution faile ...

  9. Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 mysql远程连接问题

    在用Navicat for MySQL远程连接mysql的时候,出现了 Lost connection to MySQL server at ‘reading initial communicatio ...

随机推荐

  1. delphi根据进程PID获取程序所在路径的函数(用OpenProcess取得句柄,用GetModuleFileNameEx取得程序名)

    uses psapi; {根据进程PID获取程序所在路径的函数}function GetProcessExePath(PID: Cardinal): string;varpHandle: THandl ...

  2. VA自动补全QT

    发现用了一下,VA不能把QT的东西进行代码自动补全.于是要动下小手脚. 1.在Windows系统环境变量下增加 QTDIR = 你QT的安装目录. 2启动VS->工具->选项->项目 ...

  3. js中iframe的用法

    最近遇到的项目总是习惯左边一个树,点击每个树的节点右边出现相应的信息,遇到这种情况用iframe还是很简单的, 例如 : 页面文件 @section Tree{ <ul id="tre ...

  4. 异步的 SQL 数据库封装

    引言 我一直在寻找一种简单有效的库,它能在简化数据库相关的编程的同时提供一种异步的方法来预防死锁. 我找到的大部分库要么太繁琐,要么灵活性不足,所以我决定自己写个. 使用这个库,你可以轻松地连接到任何 ...

  5. Wamp集成环境配置多站点

    一.打开apache配置文件httpd.conf 二.修改httpd.conf配置文件 1.在配置文件httpd.conf中搜索 conf/extra/httpd-vhosts.conf,然后将该行代 ...

  6. 【微信公众号】验证用户OpenID是否关注某个公众号

    1.获取OpenID #region 获取微信支付的OpenId /// <summary> /// 获取微信支付的OpenId /// </summary> /// < ...

  7. ajax:html5上传文件,上传之前可以实现本地预览

    本主题主要涉及两个新内容: 1.上传文件(主要使用了FormData) 2.本地预览(主要使用了FileReader) html5的FormData其实就是平时的Form表单,只是html5可以直接新 ...

  8. Android开发之发送短信

    本实例通过SmsManager的sendTextMessage方法实现发送短信关于SmsManager的具体解释大家能够參照:Android开发之SmsManager具体解释 实例执行效果图: 程序代 ...

  9. scrollTop,scrollLeft

    document.body.scrollTop用法 网页可见区域宽: document.body.clientWidth;网页可见区域高: document.body.clientHeight;网页可 ...

  10. cpio.gz 解压

    linux下cpio.gz文件的解压方法:今天下载了 10201_database_linux_x86_64.cpio.gz 文件,解压方法如下:1. gunzip 10201_database_li ...