错误一:
 

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. 浅谈JavaScript浮点数及其运算

    原文:浅谈JavaScript浮点数及其运算     JavaScript 只有一种数字类型 Number,而且在Javascript中所有的数字都是以IEEE-754标准格式表示的.浮点数的精度问题 ...

  2. SpringBoot笔记一

    1 开始 1.1 spring介绍 Spring Boot使开发独立的,产品级别的基于Spring的应用变得非常简单,你只需"just run". 我们为Spring平台及第三方库 ...

  3. Mysql 存储过程和函数区别

    存储过程是procedure用户定义的一系列sql语句的集合,涉及特定表或其它对象的任务,用户可以调用存储过程,而函数通常是数据库已定义的方法,它接收参数并返回某种类型的值并且不涉及特定用户表. 存储 ...

  4. 设计模式(十):Decorator装饰者模式 -- 结构型模式

    1. 概述 若你从事过面向对象开发,实现给一个类或对象增加行为,使用继承机制,这是所有面向对象语言的一个基本特性.如果已经存在的一个类缺少某些方法,或者须要给方法添加更多的功能(魅力),你也许会仅仅继 ...

  5. Django之模板语言

    一.模板语言介绍 模板语言渲染的整个过程其实就是将html转换成函数,并为该函数提供全局变量,然后执行该函数 二.模板语言的语法 模板中也有自己的语言,该语言可以实现数据展示 # 业务请求处理做的页面 ...

  6. js比较两个日期大小

    //比较两个日期大小 function dateCompare(startDate,endDate){ var aStart=startDate.split('-'); //转成成数组,分别为年,月, ...

  7. 安装orcle10g oel5.6

    一.安装OEL 5.6 二.安装VMware Tools 1)  选择菜单里的VM选项,里面有一个子选项是installVMware Tools,选择它. 2)   回到操作系统,将光驱挂载到/mnt ...

  8. solr 3.5 配置及server设置

    一.solr 的简单介绍 Apache Solr 是一个开源的搜索server.Solr 使用 Java 语言开发,主要基于 HTTP 和 Apache Lucene 实现.Apache Solr 中 ...

  9. Hadoop在Windows环境下的部署[转]

    http://blog.csdn.net/ruby97/article/details/7423088 经过一整天的折腾,参考了网上很多资料,我机器上的Hadoop似乎是配置成功了.下面分享一下详细的 ...

  10. 浏览器格式化JSON输出,thinkphp

    1 //编写类方法用$this->ajaxReturn()返回数据 2 public function index(){ 3 $user = M('User'); 5 $data = $user ...