java - Configure proguard to exclude library jar which extends android.content.Context -
i'm integrating library device project going embedded device os. this, we're integrating library jar overrides android framework context.
because of this, trying enable proguard app gives me following error - "there 220 instances of library classes depending on program classes".
all of these files widgets , views. how can fix this?
this content of proguard-project.txt
-injars bin/classes -outjars bin/classes-processed.jar -libraryjars /users/me/android-sdk-mac_86/platforms/android-15/android.jar -libraryjars libs/library-that-overrides-context.jar -keep public class * extends android.app.activity -keep public class * extends android.app.application -keep public class * extends android.app.service -keep public class * extends android.content.broadcastreceiver -keep public class * extends android.content.contentprovider -keep public class * extends android.content.context
this content of proguard-android.txt
# configuration file proguard. # http://proguard.sourceforge.net/index.html#manual/usage.html -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose # optimization turned off default. dex not code run # through proguard optimize , preverify steps (and performs # of these optimizations on own). -dontoptimize -dontpreverify # note if want enable optimization, cannot # include optimization flags in own project configuration file; # instead need point # "proguard-android-optimize.txt" file instead of 1 # project.properties file. -keepattributes *annotation* -keep public class com.google.vending.licensing.ilicensingservice -keep public class com.android.vending.licensing.ilicensingservice # native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames class * { native <methods>; } # keep setters in views animations can still work. # see http://proguard.sourceforge.net/manual/examples.html#beans -keepclassmembers public class * extends android.view.view { void set*(***); *** get*(); } # want keep methods in activity used in xml attribute onclick -keepclassmembers class * extends android.app.activity { public void *(android.view.view); } # enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations -keepclassmembers enum * { public static **[] values(); public static ** valueof(java.lang.string); } -keep class * implements android.os.parcelable { public static final android.os.parcelable$creator *; } -keepclassmembers class **.r$* { public static <fields>; } # support library contains references newer platform versions. # don't warn in case app linking against older # platform version. know them, , safe. -dontwarn android.support.**
the android ant/eclipse builds automatically specify necessary -injars/-outjars/-libraryjars options you. should specify these options if have custom build process. otherwise, you'll lots of warnings duplicate classes , possibly other problems.
if need specify -injars/-outjars/-libraryjars options, classes specified -injars can depend on classes specified -libraryjars, not other way around. cfr. proguard manual > troubleshooting > warning: library class ... depends on program class ...