2

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 *;
}
edhnb
  • 2,122
  • 3
  • 24
  • 38
  • Can you show the stack trace? – Matt K Apr 10 '14 at 19:42
  • That's the thing.. there is no stack trace. Just that one line warning.. then the app hangs. It works fine before obfuscation. – edhnb Apr 10 '14 at 19:44
  • Have you tried decompiling the obfuscated bytecode and looking at the differences? I don't use this particular obfuscator, but if you are obfuscating, you should always be decompiling, because that is what your opponent will be doing. – codenheim Apr 10 '14 at 19:44
  • 1
    Looks like you're not alone, see if this answer helps... [http://stackoverflow.com/questions/8405225/error-working-with-jackson-library-post-obfuscation-using-proguard](http://stackoverflow.com/questions/8405225/error-working-with-jackson-library-post-obfuscation-using-proguard) – Matt K Apr 10 '14 at 19:47
  • Great link. Thank You! It got me past that particular error. – edhnb Apr 10 '14 at 20:04

0 Answers0