-
siki老师好,我买了这个插件,换上以后在模拟器上一切正常。他的插件里自带了一个link.xml文件,文档里说要把这个文件放在asset目录下,我也照做了。但是在真机上还是报错,看报错的信息是在序列化具体类的时候找不到构造器。(报错信息后附)
您用过这个插件吧?有遇到类似的问题吗?谢谢。
报错信息:
JsonSerializationException: Unable to find a constructor to use for type Common.Model.User. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'ID', line 1, position 6.
at ActiveAnimation.Finish () [0x00000] in <filename unknown>:0
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, Boolean& createdFromNonDefaultCreator) [0x00000] in <filename unknown>: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 <filename unknown>: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 <filename unknown>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <filename unknown>:0
at Common.Tools.ParameterTool.GetParameter[T] (System.Collections.Generic.Dictionary`2 parameters, ParameterCode parameterCode, Boolean isObject) [0x00000] in <filename unknown>:0
at LoginRequest.OnOperationResponse (ExitGames.Client.Photon.OperationResponse operationResponse) [0x00000] in <filename unknown>:0
at PhotonEngine.OnStatusChanged (StatusCode statusCode) [0x00000] in <filename unknown>:0
at PhotonEngine.OnOperationResponse (ExitGames.Client.Photon.OperationResponse operationResponse) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.TrafficStatsGameLevel.TimeForResponseCallback (Byte code, Int32 time) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.EnetPeer.SendOutgoingCommands () [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () [0x00000] in <filename unknown>:0
at PlayerXmlManager.ClearXmlFile (System.String _name) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () [0x00000] in <filename unknown>:0
at PlayerXmlManager.ClearXmlFile (System.String _name) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.PhotonPeer.Service () [0x00000] in <filename unknown>:0
at BagRequest..ctor () [0x00000] in <filename unknown>:0
at PhotonEngine.Update () [0x00000] in <filename unknown>:0(Filename: currently not available on il2cpp Line: -1)