Retrofit2和Gson错误:java.lang.NoSuchMethodError

时间:2019-07-18 09:26:35

标签: gson retrofit2

我在解析改造呼叫响应时遇到以下错误。

Call<List<MyObj>> response = service.GetMyObjs(parameter);
List<MyObj> objects= response.execute().body(); 

Exception in thread "Timer-0" java.lang.NoSuchMethodError: com.google.gson.Gson.newJsonReader(Ljava/io/Reader;)Lcom/google/gson/stream/JsonReader;
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:37)
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:27)
at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:225)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:188)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)

这是我的构建路径

Java Build Path

我该如何解决?

0 个答案:

没有答案