2017-05-22 25 views
0

我越來越android系統中改型飛機墜毀的發佈版本的Android 1.9.0改造建設發佈異常IllegalArgument問題

Last parameter must be of type Callback<X> or Callback<? super X>. 
at retrofit.RestMethodInfo.methodError(Unknown Source) 
at retrofit.RestMethodInfo.parseResponseType(Unknown Source) 
at retrofit.RestMethodInfo.<init>(Unknown Source) 
at retrofit.RestAdapter.getMethodInfo(Unknown Source) 
at retrofit.RestAdapter$RestHandler.invoke(Unknown Source) 

我試圖從這個參考Proguard issue while using GSONhttps://github.com/square/retrofit/issues/372 Proguard的規則,但它不工作

+0

'-keepattributes Signature'是否適合您? –

回答

0

好吧,看起來你有兩個選擇:

1)將所有的反序列化和序列化模型移動到一個特定的包,並在proguard-rules.pro添加完整的包裝e名稱:

e.g. 

-keep class com.mycompany.myproject.mydata.model.** { *; } 

然後它將工作,因爲這些文件將不會被編程。

2)您可以在模型這樣的數據成員使用@SerializedName@Export註釋:

public class KeyValue { 
    @SerializedName("Key") 
    @Expose 
    private String key; 
    @SerializedName("Value") 
    @Expose 
    private String value; 

    public String getKey() { 
     return key; 
    } 

    public String getValue() { 
     return value; 
    } 
} 

,然後你甚至可以ProGuard的模型。

希望它會幫助!

+0

我試過了不行的 – user12378334

+0

你試過了什麼?只是說這不是定義任何東西 – matrix