How do I prevent the Android \"build process\" from optimizing .png images?
I have an Android project with the following res directories:
- /res/
- /
Finally there is an official way to disable the PNG cruncher with Gradle which hasn't been mentioned here yet:
Edit main build.gradle to require gradle version 1.1.3 (or newer):
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}
In the individual apps's build.gradle, section android {}, insert:
aaptOptions {
cruncherEnabled = false
}
Reference: https://code.google.com/p/android/issues/detail?id=65335