Android: What are the recommended configurations for Proguard?

Android SDK (r20 or higher) Please check the predefined proguard.config refered in project.properties proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt More info: http://proguard.sourceforge.net/manual/examples.html#androidapplication Here you can check a proguard “default” file that I keep updating: https://medium.com/code-procedure-and-rants/android-my-standard-proguard-ffeceaf65521 Android SDK (r19 or lower) Based on my answer Enabling ProGuard in Eclipse for Android I’ve ended up with this generic file. I’ve added comments … Read more

Mopub ads not showing

It is ProGuard indeed. If you don’t want it to “get rid” of Mopub, AdMob and MMedia code entirely, just put the following lines into proguard-project.txt file of your project: -keep class com.google.ads.** {*;} -keep class com.mopub.mobileads.** {*;} -keep class com.millennialmedia.android.** {*;} -keep class com.millennialmedia.google.** {*;}

Google Drive API doesn’t play well with ProGuard (NPE)

A combination of the following has worked for me: -keep class com.google.** { *;} -keep interface com.google.** { *;} -dontwarn com.google.** -dontwarn sun.misc.Unsafe -dontwarn com.google.common.collect.MinMaxPriorityQueue -keepattributes *Annotation*,Signature -keep class * extends com.google.api.client.json.GenericJson { *; } -keep class com.google.api.services.drive.** { *; } This provided a working proguard compatible solution for a recent Google Drive project. Cannot … Read more

Proguard warnings “can’t write resource [META-INF/MANIFEST.MF] (Duplicate zip entry)”

Possibly a ‘proguard.cfg’ problem. Does it include any ‘-injars’? If your project includes another project as a library, jars can be processed twice. Could you post your ‘proguard.cfg’? Extract from http://proguard.sourceforge.net/index.html#manual/troubleshooting.html: Your input jars contain multiple resource files with the same name. ProGuard continues copying the resource files as usual, skipping any files with previously … Read more