用proguard android导出apk文件时gson不工作?

时间:2014-08-22 09:56:36

标签: gson

我制作了应用程序android,当我没有用proguard导出时它工作正常。 但是当我用proguard导出apk时,我不知道为什么Gson Library无法工作。我安装在设备上,但它不能正常工作。 这是我的计划:

-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-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 public class * extends android.view.View
-keep public class * extends android.app.Fragment
-keep public class * extends android.support.v4.Fragment

-keepclassmembernames class * {
    public protected <methods>;
}

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator *;
}
-dontwarn android.print.**
-dontwarn android.app.*
-dontwarn android.graphics.pdf.*
-dontwarn android.view.accessibility.*
-dontwarn android.view.*
-dontwarn org.apache.http.**
-dontwarn android.widget.*
-dontwarn android.content.Context
-dontwarn android.graphics.drawable.Drawable
-dontwarn android.os.Environment
-dontwarn java.awt.**
-dontwarn javax.security.sasl.*
-dontwarn javax.security.auth.*
-dontwarn java.beans.*
-dontwarn javax.security.auth.callback.NameCallback
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry
-dontwarn org.joda.time.**

任何人都可以帮助我吗?

0 个答案:

没有答案