Android: How to generate proguard.cfg / proguard-project.txt

I had a few old projects from the days of Android 1.6 (API 4) which didn't make use of the proguard files. Luckily enough it was to add them in.

In a terminal:

cd android-sdk\tools
android.bat -v update project -p D:\Android\projects\codepeeker

Then add this line into your "project.properties" file:

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

This references the default proguard configuration, and then your own local one defined in "local.properties". You should not commit "local.properties" to source control as it's generated for the local development machine.

Note: be sure to check your release project! Using proguard can badly break your release APK!

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog