Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $

Posted 我想月薪过万

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $相关的知识,希望对你有一定的参考价值。

报错原因

网上大部分说是 Gson 解析时候报错,但是,我都还没写Gson解析代码,只是在编译项目的时候报错

解决方法

android studio 版本太低,更新到最新+稳定版本即可解决

效果图如下

以上是关于Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $的主要内容,如果未能解决你的问题,请参考以下文章

为啥 Gson fromJson 会抛出 JsonSyntaxException: Expected BEGIN_OBJECT but was BEGIN_ARRAY?

Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $

解决:Retrofit请求返回: Expected a string but was BEGIN_OBJECT at line 1 column 4832 path $

解决:Retrofit请求返回: Expected a string but was BEGIN_OBJECT at line 1 column 4832 path $

解决:Retrofit请求返回: Expected a string but was BEGIN_OBJECT at line 1 column 4832 path $

解决:Retrofit请求返回: Expected a string but was BEGIN_OBJECT at line 1 column 4832 path $