Unity Json.net System.Reflection.Emit 在 iOS 中的错误 [英] Unity Json.net System.Reflection.Emit error in iOS

查看:27
本文介绍了Unity Json.net System.Reflection.Emit 在 iOS 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照说明将 link.xml 包含在资产文件夹中,但我仍然收到错误消息.我认为这可能与反序列化字典有关,因为错误紧随其后:

I followed the instruction and include the link.xml in the asset folder but I still get the error. I think it might be related to deserializing dictionaries since the error comes right after:

 System.Collection.Generic.IDictionary'2:set_Item(TKey, TValue).

看起来 link.xml 中包含所有转换器,但也许我遗漏了一些东西.这是link.xml的链接

It looks like the link.xml has all the converters in it but maybe I'm missing something. This is the link to the link.xml

这是堆栈:

/Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection.Emit/DynamicMethod.cpp(20) : Unsupported internal call for IL2CPP:DynamicMethod::create_dynamic_method - System.Reflection.Emit is not supported.   at System.Reflection.Emit.DynamicMethod.CreateDynMethod () [0x00000] in <filename unknown>:0 
  at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDefaultConstructor[T] (System.Type type) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract (Newtonsoft.Json.Serialization.JsonContract contract) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateDictionaryContract (System.Type objectType) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [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.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 

推荐答案

这种情况下的错误与托管代码剥离或 link.xml 文件无关.发生此错误的原因是 Newtonsoft JSON 库尝试将 System.Reflection.Emit 与 IL2CPP 一起使用.IL2CPP 不支持运行时代码生成,因此会出现错误消息.

The error in this case is unrelated to managed code stripping or the link.xml file. This error occurs because the Newtonsoft JSON library is attempting to use System.Reflection.Emit with IL2CPP. Runtime code generation is not supported by IL2CPP, hence the error message.

这个答案表明有一个 Newtonsoft JSON 库版本虽然可以与 IL2CPP 一起使用,但您可能想尝试一下.

This answer indicates there is a version of the Newtonsoft JSON library that will work with IL2CPP though, you may want to try it instead.

这篇关于Unity Json.net System.Reflection.Emit 在 iOS 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆