解析数据时出错org.json.JSONException:字符18696处的未终止对象

时间:2012-07-06 18:53:52

标签: android json

有人可以向我解释这个错误的含义吗?我在SO上搜索了几个与我的主题相似的帖子,根据我的理解,JSON无法解析某个字符?

我正在使用Eclipse开发一个Android应用程序。

这是我的日志:

 07-06 11:07:06.276: E/JSONfunction(1269): Error parsing data org.json.JSONException: Unterminated object at character 18696 of {"driver":"230","firstName":"****","lastName":"*********","gps_data": "stale","last_geocode": "","lastLatitudeUpdate": "","suspended":"false","scheduled":"Yes","scheduled_start":"06:00","status": "0","check-in": "False","check-out": "04:09:00 06-22-2012","jobs_assigned": "25","jobs": [{ "job": "1639859", "pays": "$******", "ready_at": "7/6/2012 6:00:00 AM", "due_by": "7/6/2012 4:00:00 PM", "customer_reference": "748558 ", "pieces": "230", "weight": "0", "pickup_name": "DHL SMART & GLOBAL MAIL ", "pickup_addr1": "***** S WILMINGTON AVE ", "pickup_city": "******", "pickup_state": "CA ", "pickup_zip_postal": "***** ", "deliver_name": "DHL SMART & GLOBAL MAIL ", "deliver_addr1": "**** S. **** AVENUE", "deliver_city": "PHOENIX", "deliver_state": "AZ", "deliver_zip_postal": "85043", "signature_required": "Y", "pickup_to_see": "", "pickup_room": "", "pickup_phone": "(310) ***-****", "deliver_to_see": "", "deliver_room": "", "pickup_special_instr": "", "deliver_special_instr": "375 MILES", "deliver_phone": ""}, { "job": "*******", "pays": "$******", "ready_at": "7/6/2012 10:00:00 AM", "due_by": "7/6/2012 5:00:00 PM", "customer_reference": "DAILY: LAX-LAS ", "pieces": "230", "weight": "6", "pickup_name": "EZ ********* ", "pickup_addr1": "*** ******* AVE ", "pickup_city": "INGLEWOOD", "pickup_state": "CA ", "pickup_zip_postal": "90301 ", "deliver_name": "SAMPLES LOGISTICS ", "deliver_addr1": "7350 ******** **** STE 170", "deliver_city": "HENDERSON", "deliver_state": "NV", "deliver_zip_postal": "89011", "signature_required": "Y", "pickup_to_see": "", "pickup_room": "", "pickup_phone": "(310) ***-****", "deliver_to_see": "", "deliver_room": "", "pickup_special_instr": "", "deliver_special_instr": "", "deliver_phone": "(702) ***-****"}, { "job": "*******", "pays": "$***.00", "ready_at": "7/6/2012 10:30:00 AM", "due_by": "", "customer_reference": "7011200316.1 ", "pieces": "0", "weight": "0", "pickup_name": "LVNA - SAN DIMAS ", "pickup_addr1": "*** WEST ****** BLVD ", "pickup_city": "SAN DIMAS", "pickup_state": "CA ", "pickup_zip_postal": "***** ", "deliver_name": "LVNA WESTCOAST WAREHOUSE ", "deliver_addr1": "**** S ********* AVE", "deliver_city": "ONTARIO", "deliver_state": "CA", "deliver_zip_postal": "91761", "signature_required": "Y", "pickup_to_see": "", "pickup_room": "", "pickup_phone": "", "deliver_to_see": "", "deliver_room": "STE 100 ", "pickup_special_instr": "", "deliver_special_instr": "", "deliver_phone": "(909) ***-****"}, { "job": "*******", "pays": "$***.00", "ready_at": "7/6/2012 12:00:00 PM", "due_by": "7/7/2012 4:39:00 AM", "customer_reference": "RT #6: NORTH ORANGE ", "pieces": "230", "weight": "0", "pickup_name": "VARIOUS PICK-UPS ", "pickup_addr1": "", "pickup_city": "*******", "pickup_state": "CA ", "pickup_zip_postal": "***** ", "deliver_name": "UPS MAIL INNOVATIONS ", "deliver_addr1": "***** ****** AVE STE 100", "deliver_city": "FONTANA", "deliver_state": "CA", "deliver_zip_postal": "92337", "signature_required": "Y", "pickup_to_see": "", "pickup_room": "", "pickup_phone": "", "deliver_to_see": "", "deliver_room": "", "pickup_special_instr": "", "deliver_special_instr": "", "deliver_phone": "(909) ***-****"}, { "job": "*******", "pays": "$***.00", "ready_at": "7/6/2012 12:00:00 PM", "due_by": "7/6/2012 4:30:00 PM", "customer_reference": "7011200***.2 ", "pieces": "0", "weight": "0", "pickup_name": "LVNA - SAN DIMAS ", "pickup_addr1": "**** ********* AVE ", "pickup_city": "BALDWIN PK/IRWDL", "pickup_state": "CA ", "pickup_zip_postal": "91706 ", "deliver_name": "LVNA ********* ********* ", "deliver_addr1": "**** S ********* AVE", "deliver_city": "ONTARIO", "deliver_state": "CA", "deliver_zip_postal": "91761", "signature_required": "Y", "pickup_to_see": "", "pickup_room": "", "pickup_phone": "", "deliver_to_see": "", "deliver_room": "STE *** ", "pickup_special_instr": "REQ 24' BOBTAIL", "deliver_special_instr": "DELIVER AT 10 PMMUST GO DIRECT ANDWAIT IN YARD!", "deliver_phone": "(909) ***-****"

我不希望用银勺喂食,只希望有人能指导我朝正确的方向前进。谢谢!

编辑:如果我忘记提供任何信息,请告诉我。

2 个答案:

答案 0 :(得分:0)

JSON以'{'开头,以'}'结尾。如果日志已完成,则缺少“}”

答案 1 :(得分:0)

我已经弄明白了,有时候我的JSON字符串会返回引号,例如一个字符串返回的盒子大小尺寸为48“x40”x48“,这就是扔掉它的东西。