過程是這樣的,將項(xiàng)目從eclipse遷移到android studio 的過程中僚稿,出現(xiàn)了drawable中ico文件不識(shí)別的問題把兔,那就機(jī)智的將ico后綴改為png,這個(gè)在eclipse中是沒什么問題的煞抬,但是studio偏偏很實(shí)誠的檢查了一遍發(fā)現(xiàn)這個(gè)其實(shí)不是png,想想用ps另存為png吧构哺,但是忘了剛剛改的文件都有哪個(gè)了革答,再看一下日志,結(jié)果:
AAPT err(Facade for 1313002353): libpng error: Not a PNG file
AAPT err(Facade for 1948389872): libpng error: Not a PNG file
AAPT err(Facade for 736530827): libpng error: Not a PNG file
AAPT err(Facade for 735403482): libpng error: Not a PNG file
AAPT err(Facade for 2055634002): libpng error: Not a PNG file
鬼才能找到咧曙强,那就想辦法不讓他檢查吧残拐,果然被我百度到了,在app的build.gradle中的release目錄下添加aaptOptions.setProperty("cruncherEnabled",false)
就可以了
在代碼中的位置
android {
buildTypes {
release {
aaptOptions.setProperty("cruncherEnabled",false)
}
}