Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by mesengun · Nov 23, 2018 at 03:10 PM · jsondeserialization

Deserializing Json problem in Hololens app

Hi,
I have been trying to deserialize a json inside a hololens app that is developed by Unity 2018.2.17.f1 having il2cpp scripting backend and .net 4.x target framework.


I have tried Newtonsoft json library and Unity`s JsonUtility library, but could not achieve because of the following errors:


Newtonsoft: Configuration error JsonUtility: could not deserialize nested arrays

An example json is below:

{"RetVal":true,

"UserId":"d14ba708-5faf-4827-86b1-21468dfd35d2",

"Role":"Operator",

"Processes":[

{"Id":"e5b16261-7756-436b-a928-b9d50e341579",

"Name":"Process Test",

"Description":"Process Test Description",

"VideoURL":"~/Content/Files/e5b16261-7756-436b-a928-b9d50e341579.mp4",

"TaskCount":12,

"SubtaskCount":12,

"Tasks":null}] }


I also tried JToken but I got exception again when running on the device.

My implementation for each of these libraries works perfect in Unity editor. But when I deploy the app into Hololens, it crashes when trying to deserialize a json.

Any help is appriciated. Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Legend_Bacon · Nov 23, 2018 at 06:02 PM

Hello there,


Yeah, by default you shouldn't be using JsonUtility for anything that has more than 1 depth.

I have never used Newtonsoft, but I can recommend SimpleJSON. I use it pretty much on all my projects, and it has not failed me yet.


It has a steep-ish learning curve, but once you're over that it's pretty powerful.


Hope that helps!

Cheers,

~LegendBacon

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mesengun · Nov 24, 2018 at 04:32 PM 0
Share

It was complicated but worked great on Hololens. Thank you so much

avatar image mesengun · Nov 29, 2018 at 01:47 PM 0
Share

Now the problem is about serializing a byte array holding an image data into a json string. Have you tried this before?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

95 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Json.net deserialization problem 1 Answer

Deserializing dictionary with 'Json.Net' for Unity returns a null object. 0 Answers

"Object reference not set to an instance of an object" when attempting to parse Dictionary of Lists with JSONFx, MiniJSON 0 Answers

Json Parsing iOS with depth of json is 6. 0 Answers

Deserialize TexturePacker JSON at run time 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges