An attempt was made to call a method that does not exist. The attempt was made from the following lo
前言
今天嗨皮的敲完代码,运行代码后报错,如下错误
代码如下
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
java.lang.invoke.MethodHandleNatives.resolve(Native Method)
The following method did not exist:
com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;
The method's class, com.google.gson.GsonBuilder, is available from the following locations:
jar:file:/Users/cunweizhao/maven/rep/com/google/code/gson/gson/2.4/gson-2.4.jar!/com/google/gson/GsonBuilder.class
It was loaded from the following location:
file:/Users/cunweizhao/maven/rep/com/google/code/gson/gson/2.4/gson-2.4.jar
解决办法
上面的错误是因为引入的Gson版本不对,需要修改一下版本,就好了,
修改之前的版本:
com.google.code.gson
gson
2.4
修改版本以后:
com.google.code.gson
gson
2.8.6
可以正常访问 O(∩_∩)O哈哈~
还没有评论,来说两句吧...