Christmas came early this year to Android developers around the globe. The Android Developer Summit blew everyone away with amazing new tools, optimizations, and so much more. Google sure ain’t kidding around when they drop a major version increment!
New dexInProcess Flag
There is now a new build flag called
android.dexOptions.dexInProcess available in Android Studio 2.0. However, due to its experimental nature, it is not yet enabled by default. Michael Bendowski says it will make a huge difference! But he wants you to let him know if it works for you. (As opposed to the contrary, letting him know if it doesn’t work for you… I kid! I kid! I believe in Michael!)
You can enable the experimental flag by adding this to your build.gradle file.
|
|
android { dexOptions { dexInProcess true } } |
New Resource Shrinker
When your debug builds go over the infamous 65k method count limit, you can ask Proguard to shrink compilation resources. However, Proguard is non-incremental and disables pre-dexing, meaning it will make your build time as fast as a snail. Every. Single. Debug. Build. The tools team addresses this problem by creating a new shrinker that is dex-friendly. It aims to be both incremental and supports pre-dexing; as a stretch goal, it hopes to improve multi-dex times when targeting pre-L devices.
You can enable the experimental shrinker by adding this to your build.gradle file.
|
|
android { buildTypes { debug { minifiedEnabled true useProguard false } release { minifiedEnabled true useProguard true // can omit, true by default } } } |
Continue reading