在使用Proguard的项目上的minifyEnabled true上,使用Gson时无法正确解析ApiError类。data class ApiResponse<D>( @SerializedName,
@SerializedName("error") @Expose val error: ApiErro
我愿意付你一杯咖啡;)# Gson uses generic type information stored in a class file when working with fieldsProguard
# removes such information by default, so configure it to keep all of it.
我的代码在没有保护程序的情况下工作得很好,但是当启动proguard时,GSON就不能工作了。keep interface com.android.volley.** { *; }
# removes such information by default, so configure it to keep all of it.