discord-rpc-csharp
discord-rpc-csharp copied to clipboard
Newtonsoft.JSON error on IL2CPP
I downloaded and currently using a fork of Newtonsoft.JSON that has compatibility with Unity's IL2CPP (the original does not have this kind of support). However, I am getting this error and DiscordRPC is stuck in an endless loop. It is repeating this error.
Unity version: 2019.4 LTS Newtonsoft.JSON Fork: https://github.com/jilleJr/Newtonsoft.Json-for-Unity
TRCE: Connecting to the pipe through the DiscordRPC.Unity.UnityNamedPipe
TRCE: PIPE WIN
INFO: Connecting to discord-ipc-0 ()
INFO: Connected
TRCE: Connected to the pipe. Attempting to establish handshake...
TRCE: Enqueue Message: ConnectionEstablished
TRCE: Attempting to establish a handshake...
TRCE: Sending Handshake...
TRCE: Writing frame
TRCE: Setting the connection state to CONNECTING
TRCE: Connection Established. Starting reading loop...
TRCE: Read 0 bytes
TRCE: Read 54 bytes
TRCE: Read pipe frame!
TRCE: Read Payload: Close
ERR : Unhandled Exception: Newtonsoft.Json.JsonSerializationException
ERR : Unable to find a constructor to use for type DiscordRPC.RPC.Payload.ClosePayload. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'code', line 1, position 8.
ERR : at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <00000000000000000000000000000000>:0
at CodeStage.AntiCheat.Storage.ObscuredPrefs.DecryptValue[T] (System.String key, System.String encryptedKey, T defaultValue, System.String encryptedInput) [0x00000] in <00000000000000000000000000000000>:0
at DiscordRPC.RPC.RpcConnection.MainLoop () [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ContextCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ThreadHelper.ThreadStart () [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
TRCE: Closing the named pipe.
TRCE: Closing stream
TRCE: Setting the connection state to DISCONNECTED