如何解决android中的Unterminated数组异常

时间:2017-06-08 15:09:26

标签: java android json android-webservice

    W/System.err: org.json.JSONException: Unterminated array at character 12 of [ClassPojo [feed [{"id":0,"businessId":0,"businessName":"Farbinder","businessLogoUrl":"https:\/\/d1e6yi6s3cx2ur.cloudfront.net\/gallery\/0\/fb_icon.png","text":"Some news for yous!","photoUrl":"https:\/\/d1e6yi6s3cx2ur.cloudfront.net\/videos\/0\/8b84c9c1-50ed-4e93-9785797bbf2be667.png","videoUrl":"https:\/\/d1e6yi6s3cx2ur.cloudfront.net\/videos\/0\/_464b2fb6-ede6-403f-b6ae-1666c9504337.mov","isNew":true,"type":"news"},
{"id":198,"specialType":"limited","name":"Big Data Shoes!","description":"Get them now while you can. They're dangerous!","start":"2017-06-04 14:59:01Z","end":"2018-01-26 19:00:00Z","limitedAmount":30,"photoUrl":"https:\/\/d1e6yi6s3cx2ur.cloudfront.net\/specials\/77\/de050600-4aef-4f31-87c3-152ad4871fd4.jpeg","previewPhotoUrl":"https:\/\/d1e6yi6s3cx2ur.cloudfront.net\/specials\/77\/8878e285-8ac7-478d-aee5-73ad5fa2b861.jpeg.jpg","active":true,"expired":false,"totalClaimed":0,"totalShared":0,"businessName":"Big Data Shoes","businessId":77,"businessLogoUrl":"https:\/\/d1e6yi6s3cx2ur.cloudfront.net\/gallery\/0\/ph_logo.png","claimed":false,"redeemed":false,"isNew":false,
"shareInfo":{"title":"Big Data Shoes!","description":"Get them now while you can. They're dangerous!","photoUrl":"https:\/\/d1e6yi6s3cx2ur.cloudfront.net\/specials\/77\/de050600-4aef-4f31-87c3-152ad4871fd4.jpeg","linkUrl":"https:\/\/www.farbinder.com\/profile\/77","type":"share_info"},
"countInfo"{"views":171,"likes":0,"liked":false,"type":"count_info"},"type":"special"},
{"id":"1616636","partnerId":3,"uuid":"57dacc36-abac-4bb3-89a4-f1981130b206","title":"$80 Toward Gourmet Steakhouse Cuisine","category":"Restaurants > American","brand":"Regina's Steakhouse and Grill","imageUrl":"https:\/\/a1.lscdn.net\/imgs\/5605c229-0403-42db-a227-4720be82e29d\/360_q60.jpg","buyUrl":"https:\/\/m.livingsocial.com\/deals\/1616636-80-toward-gourmet-steakhouse-cuisine","price":"80.0 USD","salePrice":"40.0 USD","addr1":"827 Teaneck Road","city":"Teaneck","zip":"07666","type":"partner_offer"},
{"id":"b16cbffd-9162-105b-e342-511ce8e03e44","partnerId":5,"title":"Oil Change","category":"Automotive Oil Change \/ Car & Automotive","brand":"Valvoline Instant Oil Change - Galena Associates","imageUrl":"https:\/\/img.grouponcdn.com\/deal\/hzQxwQdyw5AJmR7PGf7Z\/qB-700x420\/v1\/t440x300.jpg","buyUrl":"http:\/\/tracking.groupon.com\/r?tsToken=US_AFF_0_206503_212556_0&url=https%3A%2F%2Fwww.groupon.com%2Fdeals%2Fvalvoline-instant-oil-change-47-north-jersey%3Fz%3Dskip%26utm_medium%3Dafl%26utm_campaign%3D206503%26mediaId%3D212556%26utm_source%3DGPN","price":"$35.99","salePrice":"$19.99","addr1":"289 Dolson Avenue","city":"Middletown","type":"partner_offer"},
{"id":"1651220","partnerId":3,"uuid":"58da9c36-36cf-4979-aae6-76e02bf21445","title":"IPL Photo Facial ","category":"Health & Beauty > Spas ","brand":"The PRP Institute ","imageUrl":"https:\/\/a0.lscdn.net\/imgs\/58dc2906-bf3d-4d41-be14-c7a41431c19c\/360_q60.jpg","buyUrl":"https:\/\/m.livingsocial.com\/deals\/1651220-ipl-photo-facial","price":"250.0 USD","salePrice":"99.0 USD","addr1":"639 Teaneck Road","city":"Teaneck","zip":"07666","type":"partner_offer"},
{"id":"f267f724-d556-9903-04c4-a6c68eb25d53","partnerId":5,"title":"King Spa Fitness","category":"Bath - Steam \/ Spa Services","brand":"King Spa Fitness","imageUrl":"https:\/\/img.grouponcdn.com\/deal\/bBu8ESxBwUycrCnQDvCk\/22-700x420\/v1\/t440x300.jpg","buyUrl":"http:\/\/tracking.groupon.com\/r?tsToken=US_AFF_0_206503_212556_0&url=https%3A%2F%2Fwww.groupon.com%2Fdeals%2Fking-spa-fitness-7-47%3Fz%3Dskip%26utm_medium%3Dafl%26utm_campaign%3D206503%26mediaId%3D212556%26utm_source%3DGPN","price":"$45.00","salePrice":"$26.50","addr1":"321 Commercial Ave.","city":"Palisades Park","type":"partner_offer"},
{"id":"1632898","partnerId":3,"uuid":"5849a6a8-1bd7-4848-ba0b-e12272f54d01","title":"$40 or $80 to Spend on Italian Cuisine","category":"Restaurants > American","brand":"Vitale's Restaurant","imageUrl":"https:\/\/a0.lscdn.net\/imgs\/584ad77e-3d2e-4b2a-8abe-8494ee6142fb\/360_q60.j

我想解析这个json响应并设计UI布局。但它在解析数据时抛出了异常。任何人都可以帮我解决这个问题。我发现该响应中的最后一个元素是破坏的。我我认为这就是原因。

1 个答案:

答案 0 :(得分:1)

根据此Json lint tool,您的json内容不完整。

enter image description here