抛出:IllegalArgumentException改造,没有发现标注 [英] Retrofit illegalargumentexception, no annotation found

查看:1951
本文介绍了抛出:IllegalArgumentException改造,没有发现标注的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以运行我的应用程序时,我得到这个错误:

  12月6日至17日:56:08.547 E / AndroidRuntime(23432):java.lang.IllegalArgumentException异常:XapoService.credit:没有找到改造注释所致。 (参数#1)

我有谷歌搜索,发现它可能的ProGuard造成的。我添加以下行到我的ProGuard:

  -keep类com.google.gson ** {*。 }
-keep类com.google.inject ** {*。 }
-keep类org.apache.http ** {*。 }
-keep类org.apache.james.mime4j ** {*。 }
-keep类javax.inject ** {*。 }
-keep类java.io ** {*。 }
-dontwarn改造。**
-keep类改造** {*。 }
-keepattributes签名
-keepattributes例外
-keepattributes *注释*
-keep类com.squareup.okhttp ** {*。 }
-keep接口com.squareup.okhttp。**
-keep接口改造** {*。 }
-dontwarn RX。**
-keepclasseswithmembers类* {
@ retrofit.http *<方法>
}
    -keep类com.google.common ** {*。 }
    -keep类com.mycompany.testSDK.XapoService {; }

不过,我仍然收到错误在此呼吁:

 进口retrofit.client.Response;
进口retrofit.http.GET;
进口retrofit.http.Query;
进口的java.util.List;公共接口XapoService {
    @GET(/信用卡/)
    响应信贷(@Query(APPID)字符串APPID,@Query(哈希)字符串哈希值);
}


解决方案

SDK今天更新为Android。解决了。​​

So when running my app I'm getting this error:

06-17 12:56:08.547 E/AndroidRuntime(23432): Caused by: java.lang.IllegalArgumentException: XapoService.credit: No Retrofit annotation found. (parameter #1)

I have Google searches and found it may be caused by ProGuard. I added the following lines to my ProGuard:

-keep class com.google.gson.** { *; }
-keep class com.google.inject.** { *; }
-keep class org.apache.http.** { *; }
-keep class org.apache.james.mime4j.** { *; }
-keep class javax.inject.** { *; }
-keep class java.io.** { *; }
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.**
-keep interface retrofit.** { *; }
-dontwarn rx.**
-keepclasseswithmembers class * {
@retrofit.http.* <methods>
}
    -keep class com.google.common.** { *; }
    -keep class com.mycompany.testSDK.XapoService { ; }

Yet I am still receiving the error at this call:

import retrofit.client.Response;
import retrofit.http.GET;
import retrofit.http.Query;
import java.util.List;



public interface XapoService {
    @GET("/credit/")
    Response credit(@Query("appID") String appID, @Query("hash") String hash);
}

解决方案

SDK was updated today for Android. Solved.

这篇关于抛出:IllegalArgumentException改造,没有发现标注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆