Search Unity

JSON parse error

Discussion in 'Editor & General Support' started by Marscaleb, Sep 7, 2020.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I've got this error popping up in my console, and I have no idea what this is relating to.

    ...This isn't mentioning anything that I've knowingly edited.
     
    Last edited: Sep 7, 2020
    laurG and P_Jong like this.
  2. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    This is getting really annoying. This stupid error pops up every time I save my scripts, and it doesn't clear out when they compile. So when I get back to actually testing my game I've got this long list of this exact same error popping up a dozen times.
     
    laurG and P_Jong like this.
  3. Womeesox

    Womeesox

    Joined:
    Feb 27, 2020
    Posts:
    1
    I have same problem and I don't know why it's hapening
     
    laurG likes this.
  4. laurG

    laurG

    Joined:
    Jun 1, 2017
    Posts:
    9
    I have the exact same issue for a few months already. Really looking forward to a solution.
     
  5. laurG

    laurG

    Joined:
    Jun 1, 2017
    Posts:
    9
    Alright, just after posting here that I got the same issue, I took the time to try to fix it myself.

    Turns out, something was messed up with the Settings.json file inside ..\ProjectSettings\Packages\com.unity.settings-manager\ folder. (inside your Unity project folder)

    First thing I tried was to remove that file from the folder thinking Unity will automatically regenerate it if needed. It worked! Unity regenerated a new file:

    Code (JSON):
    1. {
    2.     "m_Name": "Settings",
    3.     "m_Path": "ProjectSettings/Packages/com.unity.settings-manager/Settings.json",
    4.     "m_Dictionary": {
    5.         "m_DictionaryValues": []
    6.     }
    7. }
    No more error afterwards.

    I suggest you try to remove it from the folder and if that doesn't work, try to replace the contents of it with the contents I pasted above.

    Hope this helps someone!
     
    Ale2020, hybridshivam and Marscaleb like this.
  6. hybridshivam

    hybridshivam

    Joined:
    Feb 18, 2020
    Posts:
    3
    Worked!! Thank u
     
  7. taim_ar

    taim_ar

    Joined:
    Sep 28, 2020
    Posts:
    3
    ArgumentException: JSON parse error: The document is empty.
    i have it to but when i remove probulder 4.0.5 it's gone
    what's wrong in probulder?
     
  8. goldcloud144

    goldcloud144

    Joined:
    Jun 20, 2020
    Posts:
    9

    Can't find the "Settings.json"!
    Actually can't find "Packages" under the "ProjectSettings" folder.

    Any help guys?
     
    AldeRoberge likes this.
  9. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    This error popped up again after a power failure, but it was once again solved by deleting the settings file.

    Goldcloud144, what folders do you have int he Project settings folder? Are you looking in the correct project folder?
     
  10. unity_7180B765D6490E5D4E50

    unity_7180B765D6490E5D4E50

    Joined:
    Sep 12, 2022
    Posts:
    1
    still getting the erorr in latest version of addressable as it's showing
    ArgumentException: JSON parse error: Invalid value.
    UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at <0b59f3b614a04547a8bf657de1e23f2c>:0)
    UnityEngine.ResourceManagement.ResourceProviders.JsonAssetProvider.Convert (System.Type type, System.String text) (at Library/PackageCache/com.unity.addressables@1.21.1/Runtime/ResourceManager/ResourceProviders/JSONAssetProvider.cs:20)
    UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider+InternalOp.ConvertText (System.String text) (at Library/PackageCache/com.unity.addressables@1.21.1/Runtime/ResourceManager/ResourceProviders/TextDataProvider.cs:147)
    UnityEngine.AsyncOperation:InvokeCompletionEvent()

    any solution for this??
    if am using old version of addressable it showing player content is not build, in new versions it's showing json perse error, what should i do?
     
  11. TebogoWesi

    TebogoWesi

    Joined:
    Aug 12, 2014
    Posts:
    159
    (UNITY 2021.3.14f1 lts). After spending 5 hours trying to fix this, i took a drastic step and just deleted the whole Project Settings folder and let unity Rebuild it again. I don't recommend doing this, you will lose all of your settings in the Editor. I backed up original project Settings folder first but so far everything is working fine again.
     
  12. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.

    Source control lets you observe and track present and historical inadvertent / unwanted / unauthorized changes to files and give you one-click ability to instantly revert them. Otherwise, how could you even know that a file is corrupted when your project has thousands of files?

    Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    I usually make a separate repository for each game, but I have some repositories with a bunch of smaller test games.

    Here is how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Generally setting Unity up (includes above .gitignore concepts):

    https://thoughtbot.com/blog/how-to-git-with-unity

    It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It's simply ridiculous not to back up.

    If you plan on joining the software industry, you will be required and expected to know how to use source control.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards
     
    TebogoWesi likes this.
  13. noclipstudio

    noclipstudio

    Joined:
    Mar 2, 2021
    Posts:
    73
    Kurt Dekker, you always say a lot of technical things, but you never show the source of the problem, interesting.