Sitemap
Mobile App Development Publication

Sharing iOS, Android and relevant Mobile App Development Technology and Learning

Follow publication

Member-only story

Optimize without obfuscate your debug build

If your Release build has less than 65K method, while your debug build now complaining exceed Dex limit, what to do?

Enable Multidex for your build? That’s one way, but not ‘the way’. Let me share with you a better way.

Optimize without obfuscate

We all know the reason debug build is over 65k dex limit is because of many unused methods are included, especially from external libraries, while Release build, we have Proguard to remove them cleanly.

The simple thought is, let’s proguard the debug build. Unfortunately, if you use Proguard on debug build, the code got obfuscated as well, causing debugging a challenge (e.g. you can’t trace the variable value in the debugger).

The good news is, Proguard has the setting -dontobfuscate that you could set in your proguard-rules.pro file. Using that you will get your code optimized but not obfuscated.

This works perfectly. BUT … the problem though is, you still want to obfuscate your release build. So you’ll need to have two different set of proguard-rules.pro for your build, i.e one for release, the other for your debug. Well… clearly this is not ‘the way’ you prefer.

How nice if you can share one proguard-rules.pro file, with setting to turn on-off obfuscation…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Mobile App Development Publication
Mobile App Development Publication

Published in Mobile App Development Publication

Sharing iOS, Android and relevant Mobile App Development Technology and Learning

Elye - A One Eye Dev By His Grace
Elye - A One Eye Dev By His Grace

Written by Elye - A One Eye Dev By His Grace

Sharing Software, Life and Faith Journey. Follow me on Twitter/X to access to my article free

Responses (5)

Write a response