saki4510t / UVC4UnityAndroid

UVC4UnityAndroid
Apache License 2.0
77 stars 19 forks source link

Blocked by System.Text.Json #1

Closed zyowo closed 4 years ago

zyowo commented 4 years ago

Hi, I really like your UVC camera project. I'm trying to download System.Test.Json using NuGetForUnity.2.0.0 on Unity 2019.3.2f1, but (probably because of network issues) always fails:

Unable to install package System.Runtime.CompilerServices.Unsafe 4.5.2 Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Ionic.Zip.BadReadException: Could not read block - no data! (position 0x000050C6) I tried using your Unity project directly, and it looks like System.Text.Json is installed, but I still get:

Assets\UVC4UnityAndroidPlugin\Scripts\SupportedFormats.cs(8,19): error CS0234: The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

I want to be able to export the Android Studio project and look at the code on the Java side, but if there is an error, it cannot be exported. Can you help me with some suggestions, or can you help me export the project? Any help would be greatly appreciated. Thank you very much.

saki4510t commented 4 years ago

Hi, I use Unity 2018.4.x LTS release and I don't confirm this project can run with Unity 2019.3.x.

I use System.Text.Json(by Microsoft) to parse(desirialize) json string from Java side and set those infos into c# object. So generally you can use any json parser.

zyowo commented 4 years ago

Well... first install System.Runtime.CompilerServices.Unsafe 4.5.2 separately using NuGet For Unity, and then install System.Text.Json, and that's it. I don't understand why installing directly is wrong.