applejag/Newtonsoft.Json-for-Unity

Build question

leeyesang opened this issue · 5 comments

Hello dear

There is a problem with the build in Newtonsoft.json.

This problem Jobject does not work. and I find this package

using this package no problem Jobject after build?

If you still have the same problem after using this package, my only option is to migrate...

this is my error code

at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDynamicMethod (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner) [0x00018] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDefaultConstructor[T] (System.Type type) [0x00010] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator (System.Type createdType) [0x00005] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract (Newtonsoft.Json.Serialization.JsonContract contract) [0x00093] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateDictionaryContract (System.Type objectType) [0x00007] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x00089] in <2676a2da6edc420e890ed28aa4572ee5>:0
at System.Collections.Concurrent.ConcurrentDictionary2[TKey,TValue].GetOrAdd (TKey key, System.Func2[T,TResult] valueFactory) [0x00034] in :0
at Newtonsoft.Json.Utilities.ThreadSafeStore`2[TKey,TValue].Get (TKey key) [0x00000] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [0x0000b] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetContract (System.Type type) [0x00000] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetContractSafe (System.Type type) [0x0000b] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x0000e] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00012] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType) [0x002ff] in <2676a2da6edc420e890ed28aa4572ee5>:0
at Newtonsoft.Json.Linq.JToken.ToObject[T] () [0x00000] in <2676a2da6edc420e890ed28aa4572ee5>:0
at ConnectionManager+d__54.MoveNext () [0x00151] in Z:\Developments\DT\Unity\DT_Navigator\Assets\DB\Connection\ConnectionManager.cs:279
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00020] in C:\buildslave\unity\build\Runtime\Export\Scripting\Coroutines.cs:17

Hello! Thank you for reaching out instead of just switching :)

Yes, this package resolves that issue/error that you pasted.

There are some errors this package does not fix automatically for you, so I recommend you to read up on how to Fix AOT compilation errors.

Good luck! :)

Thank you for your answer.
I checked that the dll was added and I checked the compatible code without any problems. When I built with .net standard 2.0, I got the same error code as above. Can this be solved with an AOT fix?? If so, I'll refer to what you told me. Also, it says that there is no 'containkey' (
jObj.ContainsKey("temp") ), can't I use it??
I want to give conditions to if the certain key exists in if statement.

thank you :)

@leeyesang Sounds like you're using DLLs from the wrong source. Perhaps you're using an older Newtonsoft.Json.dll even, as jObject.ContainsKey was added in something like v10.0 or v11.0 if I recall correctly

Changed successfully thanks to you. Thanks for making a great program good luck:)

Glad I could help :) I'm closing this issue as I conclude it as resolved. Don't fray in reopening it if I misunderstood