重打包资源报错解决
2016-06-15 18:51
2176 查看
遇到的APK可以正常反编译,打包时会出现如下错误:
I: Using Apktool 2.1.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_1.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_1.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_2.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_2.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_3.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_3.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_4.png
W: libpng error: Not a PNG file
查看文件格式:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202006/04/e4e183e279cf5c61fe3b38c83ba42f5e)
原来并不是png文件,将后缀名改为exif后便可重打包运行。
由于涉及到的png文件比较多,用下面这个命令可以批量修改:
grep "\.png" log.txt | awk '{fileName=substr($7,0,length($7)-3);system("mv "$7" "fileName".exif")}'
I: Using Apktool 2.1.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_1.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_1.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_2.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_2.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_3.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_3.png
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_4.png
W: libpng error: Not a PNG file
查看文件格式:
原来并不是png文件,将后缀名改为exif后便可重打包运行。
由于涉及到的png文件比较多,用下面这个命令可以批量修改:
grep "\.png" log.txt | awk '{fileName=substr($7,0,length($7)-3);system("mv "$7" "fileName".exif")}'
相关文章推荐
- 阅读程序
- Android访问数据文件
- java Swing 开发cs的C/S版的一个小工具软件
- CSS3变形之2D变形
- CButtonST使用技巧
- Android+PHP简单实现
- 阅读程序
- 如何给自己各种帐号编一个安全又不会忘记的密码?
- python学习笔记 序列化
- MBProgressHUD ---
- 继承与派生——两个程序的比较 2
- 第十四周项目3—数组类模板
- php 日常函数
- LHG 弹层问题汇总
- 实现文本框有个默认值
- eclipse-java/spring mvc常见错误
- 说一说物理中的dynamics和kinetics
- 阅读程序
- Leetcode 83. Remove Duplicates from Sorted List
- 不同的包下有文件名相同的java类,spring自动注入会报错