问题
I am having issues with my app once I obfuscate the code with ProGuard. The app launches ok, but once I try to make a REST call to my server, I get the below error in the LogCat.. and the app just hangs.
Exception Ljava/lang/NullPointerException; thrown while initializing Lorg/codehaus/jackson/map/introspect/VisibilityChecker$Std;
Any help is appreciated.. as I have searched the entire internet :|
Below is my pro guard .cfg contents:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
-printmapping mapping.txt
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-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.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keep class com.vungle.sdk.** { *; }
-keep class org.codehaus.** { *; }
-keep class javax.** { *; }
-dontwarn javax.**
-keep class org.apache.** { *; }
-dontwarn org.apache.**
-keep class log4j.** { *; }
-dontwarn log4j.**
-keep class jtwitter4j.** { *; }
-dontwarn twitter4j.**
-keep class android.print.** { *; }
-dontwarn android.print.**
-keep class org.joda.** { *; }
-dontwarn org.joda.**
-keep class org.w3c.** { *; }
-dontwarn org.w3c.**
-keep class org.json.** { *; }
-dontwarn org.json.**
-keep class android.** { *; }
-dontwarn android.**
-keep class java.io.** { *; }
-dontwarn java.io.**
-keep class java.lang.String.** { *; }
-dontwarn java.lang.String.**
-keep class java.beans.** { *; }
-dontwarn java.beans.**
-keepclassmembers class * implements java.io.Serializable
{
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
来源:https://stackoverflow.com/questions/22997476/proguard-obfuscating-apk-causing-error