Getting JSON parse error: The document is empty..

0 votes
asked Dec 8, 2016 in Issue by quadchess (200 points)

I've been getting this error for a while, and have been trying to ignore it since it's not preventing it from running or compiling, but it's that's one red exclamation point I see every time.  It says this:

System.ArgumentException: JSON parse error: The document is empty.
  at (wrapper managed-to-native) UnityEngine.JsonUtility:FromJson (string,System.Type)
  at UnityEngine.JsonUtility.FromJson[MaterialUiData] (System.String json) [0x00000] in C:\buildslave\unity\build\artifacts\generated\common\modules\JSONSerialize\JsonUtilityBindings.gen.cs:25 
  at MaterialUI.MaterialUIDataTool.LoadData () [0x0003b] in D:\....\Assets\MaterialUI\Editor\Tools\MaterialUIDataTool.cs:87 
  at MaterialUI.MaterialUIDataTool.Initialize () [0x00000] in D:\....\Assets\MaterialUI\Editor\Tools\MaterialUIDataTool.cs:43 
  at MaterialUI.MaterialUIDataTool..cctor () [0x0000b] in D:\....\Assets\MaterialUI\Editor\Tools\MaterialUIDataTool.cs:38 
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

Any clue on what to do?  Hard to tell you when it first happened, if there's something I did that triggered it, or where in my project I can debug it since it doesn't tell me any specifics and I didn't want to dig into MaterialUIDataTool.cs if nobody else gets this problem.  Thanks, my implementation is looking great so far, just trying to work out the kinks..

 

commented Dec 11, 2016 by admin (31,720 points)
Hello,

That's a weird error indeed!
Can you check at the root of the MaterialUI folder, you should see a file called MaterialUIData.

1) Do you have it?
2) If yes, can you open it with a text editor and paste the content here?

Thanks a lot!

~ Yohan
commented Dec 12, 2016 by quadchess (200 points)
Huhh, I have the MaterialUIDate file, but when I open it, there's nothing but empty NUL 28 times, and it's 28 bytes big.. If there's supposed to be something in there, that's probably part of the problem.  Now what would you recommend?
commented Dec 12, 2016 by admin (31,720 points)
Try adding exactly this inside:
{"m_UsedVersions":["1.1.6"]}

If you're using 1.1.6 :) (if you're using 1.1.5, write 1.1.5 etc...)

And it should work!
commented Dec 13, 2016 by quadchess (200 points)
Excellent, that did the trick!  Thanks a lot, simple enough.  Now on to debugging the other little issues, but back on track.  Looking real good now, wish the API was better documented, but managing to figure out all the little ins and outs with enough tinkering.  Thanks again.
commented Dec 14, 2016 by admin (31,720 points)
Perfect!
Glad I could help.
And yes, there's still a lot to do to improve MaterialUI :)

~ Yohan

1 Answer

0 votes
answered Dec 14, 2016 by admin (31,720 points)
 
Best answer
At the root of the MaterialUI folder, you should see a file called MaterialUIData. Try adding exactly this inside:
{"m_UsedVersions":["1.1.6"]}

If you're using 1.1.6 :) (if you're using 1.1.5, write 1.1.5 etc...)

And it should work!

~ Yohan
Welcome to MaterialUI support! Ask us anything :)
...