After switching to Android Studio 3.0, the drawable 'png' is NOT compressed in the debug build

Gestures that are compressed in release types but not compressed in debug types.

Android Studio 3.0 Build #AI-171.4408382, built on October 20, 2017 JRE: 1.8.0_152-release-915-b01 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains sro Linux 4.10.0-38-generic

In the previous version, drawable was always compressed

How to configure debug assemblies to compress png drawings?

0
source share
1 answer

The reason for this is documented here.

Here is a quote

If you use the Android plugin 3.0.0 or higher, PNG crunch is disabled by default only for the debug build type

I solved my problem by adding crunchPngs true to debug the assembly type configuration in build.gradle :

 buildTypes { debug { minifyEnabled false shrinkResources false crunchPngs true # <------ This option } 
+1
source

Source: https://habr.com/ru/post/1269703/


All Articles