美文网首页
GSON: Expected a string but was

GSON: Expected a string but was

作者: moushao | 来源:发表于2017-06-05 11:26 被阅读912次

    Gson解析遇到错误:GSON: Expected a string but was BEGIN_OBJECT?

    一般来说,这个错误是因为你在根据json字符串建立实体类的时候,结构或者字段属性匹配错误,

    比如应该是:
    private List<User> xxxList;

    结果手误会写成:
    private List<String> xxxList;

    这个错误很简单,但要仔细的去找.
    更多问题加群:584275290

    相关文章

      网友评论

          本文标题:GSON: Expected a string but was

          本文链接:https://www.haomeiwen.com/subject/lcjifxtx.html