当前位置: 代码迷 >> Android >> JSON 解析异常
  详细解决方案

JSON 解析异常

热度:78   发布时间:2016-04-28 04:55:28.0
JSON 解析错误
本帖最后由 u014087472 于 2014-06-23 10:09:57 编辑


这是报错异常
    154: I/com.pengsheng.channel.MeetServiceImpl(3379): result{"phone":"10002","last_time":"2014-06-23 09:26:09"}
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379): JSON数据错误
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379): org.json.JSONException: Value {"phone":"10002","last_time":"2014-06-23 09:26:09"} of type org.json.JSONObject cannot be converted to JSONArray
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at org.json.JSON.typeMismatch(JSON.java:111)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at org.json.JSONArray.<init>(JSONArray.java:91)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at org.json.JSONArray.<init>(JSONArray.java:103)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at com.pengsheng.channel.MeetServiceImpl.getOneVoice(MeetServiceImpl.java:450)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at com.pengsheng.task.MeetOneVoiceTask.doInBackground(MeetOneVoiceTask.java:26)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at com.pengsheng.task.MeetOneVoiceTask.doInBackground(MeetOneVoiceTask.java:1)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-23 09:43:00.159: E/com.pengsheng.channel.MeetServiceImpl(3379):  at java.lang.Thread.run(Thread.java:838)
------解决方案--------------------
异常说的很清楚,你的JSON是个object,你却像把它弄成array
  相关解决方案