JSON不会编译,给出:“期待'STRING','NUMBER','NULL','TRUE','FALSE','{','['”错误

时间:2021-01-27 17:04:51

Can someone please tell me whats wong with this code? Ive tried everything and don't know why it keeps giving me this error:

有人可以用这个代码告诉我wow wong wong吗?我尝试了一切,不知道为什么它一直给我这个错误:

Parse error on line 3: ...", "shortName": “Simple”, "longN

第3行解析错误:...“,”shortName“:”简单“,”longN

----------------------------------------------^

Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

期待'STRING','NUMBER','NULL','TRUE','FALSE','{','['

{
    "uuid": "13371337-d579-4d75-a5c5-8dfcfe110f62",
    "shortName": “Simple”,
    "longName": “Simple”,
    "companyName": “pjtnt11”,
    "versionCode": 1,
    "versionLabel": “1.7”,
    "watchapp": 
        {
            "watchface": true
        },
    "appKeys": 
        {
            "dummy": 0
        },
    "resources": 
        {
            "media": []
        }
}

Thanks!

1 个解决方案

#1


10  

You're using “ instead of " for many of your strings. Those may not look like different double-quote characters, but they are. Only the latter is valid in JSON.

对于许多字符串,你使用“而不是”。这些字符可能看起来不像是不同的双引号字符,但它们是。只有后者在JSON中有效。

This usually happens to me when pasting quotation marks from another program, especially office software that likes to make its quotes look as fancy as possible.

当粘贴来自另一个程序的引号时,通常会发生这种情况,尤其是那些喜欢使其引号看起来尽可能花哨的办公软件。

The corrected JSON would be:

更正的JSON将是:

{
    "uuid": "13371337-d579-4d75-a5c5-8dfcfe110f62",
    "shortName": "Simple",
    "longName": "Simple",
    "companyName": "pjtnt11",
    "versionCode": 1,
    "versionLabel": "1.7",
    "watchapp": {
        "watchface": true
    },
    "appKeys": {
        "dummy": 0
    },
    "resources": {
        "media": [

        ]
    }
}

#1


10  

You're using “ instead of " for many of your strings. Those may not look like different double-quote characters, but they are. Only the latter is valid in JSON.

对于许多字符串,你使用“而不是”。这些字符可能看起来不像是不同的双引号字符,但它们是。只有后者在JSON中有效。

This usually happens to me when pasting quotation marks from another program, especially office software that likes to make its quotes look as fancy as possible.

当粘贴来自另一个程序的引号时,通常会发生这种情况,尤其是那些喜欢使其引号看起来尽可能花哨的办公软件。

The corrected JSON would be:

更正的JSON将是:

{
    "uuid": "13371337-d579-4d75-a5c5-8dfcfe110f62",
    "shortName": "Simple",
    "longName": "Simple",
    "companyName": "pjtnt11",
    "versionCode": 1,
    "versionLabel": "1.7",
    "watchapp": {
        "watchface": true
    },
    "appKeys": {
        "dummy": 0
    },
    "resources": {
        "media": [

        ]
    }
}