您的位置:首页 > 其它

重打包资源报错解决

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

查看文件格式:



原来并不是png文件,将后缀名改为exif后便可重打包运行。

由于涉及到的png文件比较多,用下面这个命令可以批量修改:

grep "\.png" log.txt | awk '{fileName=substr($7,0,length($7)-3);system("mv "$7" "fileName".exif")}'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: