JSON角色的未终止对象

时间:2016-03-15 08:31:23

标签: java android json

我想从互联网上阅读json,现在我可以从互联网上读到字符串但是我可能犯了一个我在json中找不到的错误:

{
     "S4ROMS" :[
     {
        "name":"Cyanogenmod 13",
        "android":"6.0.1",
        "status":"nightly",
        "description":"If you like android, you probably can't wait till your phone gets updates but cyanogenmod 13 brings you not just original android 6.0.1, it comes with root access, option to apply themes, option to switch from hardware to on screen buttons, the rest you will know when you install it.",
        "tested":true,
        "website":"https://download.cyanogenmod.org/?device=jfltexx",
        "image":"http://images.technewstoday.com.s3.amazonaws.com/tnt/how-to-install-android-marshmallow-samsung-galaxy-s4-using-cm13-rom.jpg",
        "gapps":true
     },
     {
        "name":"S4 Google Edition",
        "android":"4.4.4",
        "status":"stable",
        "description":"Feel the experience of Nexus - this tells you everything.",
        "tested":false,
        "website":"http://forum.xda-developers.com/showthread.php?t=2544474",
        "image":"http://abload.de/img/1qzo3r.png",
        "gapps":false
     },
     {
        "name":"PhoeniX ROM v11.6",
        "android":"5.0.x",
        "status":"stable"
        "description":"Stock 5.0 Samsung Galaxy S4 touchwiz rom with some mods, hacks and addons.",
        "tested":true,
        "website":"http://forum.xda-developers.com/showthread.php?t=2349584",
        "gapps":false
     },
     {
        "name":"Miui 7",
        "android":"4.4.x",
        "status":"stable with some bugs",
        "description":"Chinese rom based on Samsung Galaxy S4 with brand new UI looking like Iphone.",
        "tested":false,
        "website":"http://forum.xda-developers.com/galaxy-s4/i9505-develop/4-4-miui-7-t3184430",
        "image":"http://abload.de/img/1qzo3r.png",
        "gapps":false
     },
     {
        "name":"AOKP",
        "android":"4.4.x",
        "status":"stable"
        "description":"AOSP based rom with some tweaks.",
        "tested":true,
        "website":"http://aokp.co/devices/jflte",
        "image":"http://abload.de/img/1qzo3r.png",
        "gapps":true
     },
     {
        "name":"SOKP",
        "android":"4.4.x",
        "status":"stable",
        "description":"Cyanogen Mod 11.0 based rom with some tweaks.",
        "tested":false,
        "website":"http://forum.xda-developers.com/showthread.php?t=2724109",
        "image":"http://abload.de/img/1qzo3r.png",
        "gapps":true
     },
     {
        "name":"XenonHD",
        "android":"4.4.2",
        "status":"alpha 1",
        "description":"The idea behind XenonHD is to give users a ROM that is 'blazing fast, rock stable and battery smooth'. The ROM is based on AOSP.",
        "tested":false,
        "website":"http://forum.xda-developers.com/showthread.php?t=2737839",
        "image":"http://abload.de/img/1qzo3r.png",
        "gapps":true
     },
     {
        "name":"SlimSaberKat",
        "android":"4.4.4",
        "status":"stable",
        "description":"The ROM is based on SlimKat (AOSP).",
        "tested":false,
        "website":"http://forum.xda-developers.com/showthread.php?t=2760650",
        "image":"http://abload.de/img/1qzo3r.png",
        "gapps":true
     }
     ] 
  }

java android代码从intenrnet读取它,如果我删除除了前2个jsonarrays之外的所有内容它也会读取它并提供预期的输出但是当我使用所有json代码时它会给出我的异常

org.json.JSONException: Unterminated object at character 1098 of {         "S4ROMS" :[         {            "name":"Cyanogenmod 13",            "android":"6.0.1",          "status":"nightly",         "description":"If you like android, you probably can't wait till your phone gets updates but cyanogenmod 13 brings you not just original android 6.0.1, it comes with root access, option to apply themes, option to switch from hardware to on screen buttons, the rest you will know when you install it.",           "tested":true,          "website":"https://download.cyanogenmod.org/?device=jfltexx",           "image":"http://images.technewstoday.com.s3.amazonaws.com/tnt/how-to-install-android-marshmallow-samsung-galaxy-s4-using-cm13-rom.jpg",         "gapps":true         },      {            "name":"S4 Google Edition",            "android":"4.4.4",         "status":"stable",          "description":"Feel the experience of Nexus - this tells you everything.",          "tested":false,         "website":"http://forum.xda-developers.com/showthread.php?t=2544474",           "image":"http://abload.de/img/1qzo3r.png",          "gapps":false         },         {            "name":"PhoeniX ROM v11.6",            "android":"5.0.x",         "status":"stable"           "description":"Stock 5.0 Samsung Galaxy S4 touchwiz rom with some mods, hacks and addons.",         "tested":true,          "website":"http://forum.xda-developers.com/showthread.php?t=2349584",           "gapps":false         },         {            "name":"Miui 7",            "android":"4.4.x",            "status":"stable with some bugs",           "description":"Chinese rom based on Samsung Galaxy S4 with brand new UI looking like Iphone.",          "tested":false,         "website":"http://forum.xda-developers.com/galaxy-s4/i9505-develop/4-4-miui-7-t3184430",            "image":"http://abload.de/img/1qzo3r.png",          "gapps":false         },         {            "name":"AOKP",            "android":"4.4.x",          "status":"stable"           "description":"AOSP based rom with some tweaks.",           "tested":true,          "website":"http://aokp.co/devices/jflte",           "image":"http://abload.de/img/1qzo3r.png",          "gapps":true         },      {            "name":"SOKP",            "android":"4.4.x",          "status":"stable",          "description":"Cyanogen Mod 11.0 based rom with some tweaks.",          "tested":false,         "website":"http://forum.xda-developers.com/showthread.php?t=2724109",           "image":"http://abload.de/img/1qzo3r.png",          "gapps":true         },      {            "name":"XenonHD",            "android":"4.4.2",           "status":"alpha 1",         "description":"The idea behind XenonHD is to give users a ROM that is 'blazing fast, rock stable and battery smooth'. The ROM is based on AOSP.",           "tested":false,         "website":"http://forum.xda-developers.com/showthread.php?t=2737839",           "image":"http://abload.de/img/1qzo3r.png",          "gapps":true         },      {            "name":"SlimSaberKat",            "android":"4.4.4",          "status":"stable",          "description":"The ROM is based on SlimKat (AOSP).",            "tested":false,         "website":"http://forum.xda-developers.com/showthread.php?t=2760650",           "image":"http://abload.de/img/1qzo3r.png",          "gapps":true         }         ]       }

3 个答案:

答案 0 :(得分:4)

PhoeniX ROM v11.6的阻止中,status之后缺少逗号。

答案 1 :(得分:1)

问题是json对象值包含引号,如“stable”“description”:“Stock 5.0 Samsung Galaxy S4 touchwiz rom with some mods,hacks and addons。”,“testing”:true,“website”:“ http://forum.xda-developers.com/showthread.php?t=2349584“,”gapps“:false

将其粘贴到json解析器/ validitor中显示错误 http://json.parser.online.fr/

答案 2 :(得分:1)

以下照片会在您的代码中显示错误原因............. enter image description here

这里缺少逗号......