美文网首页
com.google.gson.JsonSyntaxExcept

com.google.gson.JsonSyntaxExcept

作者: 晓晓桑 | 来源:发表于2019-03-26 11:29 被阅读0次

    com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Invalid double: "LAKI-LAKI"

    json语法异常:数字格式化异常:无效的double "LAKI-LAKI",就是LAKI-LAKI不是double类型。查看网络请求返回数据

    {"code":0,"success":true,"data":{"id":511,"createTime":1553239018000,"modifyTime":1553567845000,"username":null,"idNumber":"3674052906960004","areaCode":"62","phoneNumber":"085930398079","loanPurpose":null,"gender":"LAKI-LAKI","birthplace":null,"birthday":835977600000,"maritalStatus":0,"educationBackground":5,"email":"123@qq.com","token":"7558f974-0f4c-46ba-9b9e-671af331d6d5","usernameShort":"REZON JULIO HALIEMAN","password":null,"cpf":null,"registerTime":null,"motherName":"qqq","city":"qqq","block":"qqq","currentResidential":null,"residentialPostcode":null,"residentialDuration":5,"homeTelephoneAreaCode":null,"homeTelephone":null,"headPortrait":null,"deviceId":null,"childNumber":2,"street":"qqq","regent":"qqq","province":"Aceh","provinceCode":"1","whatsapp":"147258369","residentialType":"3"},"message":null,"page":null}
    

    gender":"LAKI-LAKI"
    果然数据模型中 private int gender;
    将其改为String即可。

    相关文章

      网友评论

          本文标题:com.google.gson.JsonSyntaxExcept

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