proguard Missing type parameter

后端 未结 3 1042
闹比i
闹比i 2020-11-29 03:15

i try obfuscate my code of android app with ProGuard. But after this my app give exception at running:

11-15 01:46:26.818: W/System.err(21810)         


        
3条回答
  •  忘掉有多难
    2020-11-29 03:22

    Since I didn't notice the link in the question at first, here are the specific lines mentioned in the thread needed to get GSON to work with Proguard:

    # Gson uses generic type information stored in a class file when working with fields. Proguard
    # removes such information by default, so configure it to keep all of it.
    -keepattributes Signature
    
    # Gson specific classes
    -keep class sun.misc.Unsafe { *; }
    #-keep class com.google.gson.stream.** { *; }
    
    # Application classes that will be serialized/deserialized over Gson
    -keep class com.google.gson.examples.android.model.** { *; }
    

提交回复
热议问题