为了账号安全,请及时绑定邮箱和手机立即绑定

为啥代码是对的,还是有报错

Exception in thread "main" java.lang.RuntimeException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

at com.imooc.weather.impl.WeatherUtilsImpl.w24h(WeatherUtilsImpl.java:82)

at com.test.weather.Application.main(Application.java:22)

Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

at com.google.gson.Gson.fromJson(Gson.java:944)

at com.google.gson.Gson.fromJson(Gson.java:897)

at com.google.gson.Gson.fromJson(Gson.java:846)

at com.imooc.weather.impl.WeatherUtilsImpl.w24h(WeatherUtilsImpl.java:60)

... 1 more

Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:386)

at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:183)

at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)

at com.google.gson.Gson.fromJson(Gson.java:932)

... 4 more


正在回答

举报

0/150
提交
取消

为啥代码是对的,还是有报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信