Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 例外情况';正在尝试JIT编译方法,同时使用--aot only';使用Google.ProtocolBuffersLite_Ios_Mono_Unity3d_Protocol Buffers_Aot - Fatal编程技术网

Ios 例外情况';正在尝试JIT编译方法,同时使用--aot only';使用Google.ProtocolBuffersLite

Ios 例外情况';正在尝试JIT编译方法,同时使用--aot only';使用Google.ProtocolBuffersLite,ios,mono,unity3d,protocol-buffers,aot,Ios,Mono,Unity3d,Protocol Buffers,Aot,我在Unity3d项目中使用的类库中使用Google.ProtocolBuffersLite。 在IOS上尝试在应用程序的myClass.cs中使用ParseFrom(System.Byte[]data)函数时,我遇到以下异常: ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Collections.Generic.EqualityComp

我在Unity3d项目中使用的类库中使用Google.ProtocolBuffersLite。 在IOS上尝试在应用程序的myClass.cs中使用ParseFrom(System.Byte[]data)函数时,我遇到以下异常:

---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Collections.Generic.EqualityComparer`1 
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 
---> System.ExecutionEngineException: Attempting to JIT compile method 'System.Collections.Generic.GenericEqualityComparer`1<Google.ProtocolBuffers.ExtensionRegistry/ExtensionIntPair>:.ctor ()' while running with --aot-only.

  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.EqualityComparer`1[Google.ProtocolBuffers.ExtensionRegistry+ExtensionIntPair]..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Collections.Generic.Dictionary`2[Google.ProtocolBuffers.ExtensionRegistry+ExtensionIntPair,Google.ProtocolBuffers.IGeneratedExtensionLite].Init (Int32 capacity, IEqualityComparer`1 hcp) [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.Dictionary`2[Google.ProtocolBuffers.ExtensionRegistry+ExtensionIntPair,Google.ProtocolBuffers.IGeneratedExtensionLite]..ctor () [0x00000] in <filename unknown>:0 
  at Google.ProtocolBuffers.ExtensionRegistry..cctor () [0x00000] in <filename unknown>:0  Exception.Message: An exception was thrown by the type initializer for Google.ProtocolBuffers.ExtensionRegistry
at Google.ProtocolBuffers.AbstractBuilderLite`2[TMessage,TBuilder].MergeFrom (System.Byte[] data) [0x00000] in <filename unknown>:0 
-->System.TypeInitializationException:System.Collections.Generic.EqualityComparer`1的类型初始值设定项引发了异常
--->System.Reflection.TargetInvocationException:调用的目标已引发异常。
--->System.ExecutionEngineeException:尝试在仅使用--aot运行时JIT编译方法“System.Collections.Generic.GenericEqualityComparer`1:.ctor()”。
在System.Reflection.MonoCMethod.Invoke(System.Object obj、BindingFlags invokeAttr、System.Reflection.Binder Binder、System.Object[]参数、System.Globalization.CultureInfo区域性)[0x00000]中:0
---内部异常堆栈跟踪的结束---
在System.Reflection.MonoCMethod.Invoke(System.Object obj、BindingFlags invokeAttr、System.Reflection.Binder Binder、System.Object[]参数、System.Globalization.CultureInfo区域性)[0x00000]中:0
在System.Reflection.MonoCMethod.Invoke(BindingFlags invokeAttr、System.Reflection.Binder Binder、System.Object[]参数、System.Globalization.CultureInfo区域性)[0x00000]中:0
在:0中的System.Reflection.ConstructorInfo.Invoke(System.Object[]参数)[0x00000]处
在:0中的System.Activator.CreateInstance(System.Type类型,布尔非公共)[0x00000]处
在0中的System.Activator.CreateInstance(System.Type类型)[0x00000]处
位于System.Collections.Generic.EqualityComparer`1[Google.ProtocolBuffers.ExtensionRegistry+ExtensionIntPair]…cctor()[0x00000]中:0
---内部异常堆栈跟踪的结束---
位于System.Collections.Generic.Dictionary`2[Google.ProtocolBuffers.ExtensionRegistry+ExtensionIntPair,Google.ProtocolBuffers.IGeneratedExtensionLite].Init(Int32容量,IEqualityComparer`1 hcp)[0x00000]中:0
位于System.Collections.Generic.Dictionary`2[Google.ProtocolBuffers.ExtensionRegistry+ExtensionIntPair,Google.ProtocolBuffers.IGeneratedExtensionLite]…ctor()[0x00000]中:0
在Google.ProtocolBuffers.ExtensionRegistry..cctor()[0x00000]中:0异常。消息:Google.ProtocolBuffers.ExtensionRegistry的类型初始值设定项引发了异常
在Google.ProtocolBuffers.AbstractBuilderLite`2[TMessage,TBuilder].MergeFrom(System.Byte[]data)[0x00000]中:0
使用protocolBuffersLite的过程是:

  • 添加选项optimize_for=LITE_RUNTIME;在我的原型课上
  • 使用.proto类和Google.ProtocolBuffers.dll版本net20生成.cs类
  • 将.cs类和Google.ProtocolBuffersLite.dll添加到我的库csharp proj中
  • 使用monoDevelop 2.8.2编译
  • 将使用Protocol.dll和Google.ProtocolBuffersLite.dll的MyLibrary移动到myUnity3d项目
  • 在Unity3D->构建设置->IOS->播放器设置中,我使用:

    Api兼容级别:.net 2.0子集

    Aot编译选项:空

    剥离级别:禁用
  • 在Unity3d中构建应用程序(版本4.2.0)
  • 在Xcode中运行应用程序
  • 如果有人能提供任何帮助,我将不胜感激


    你好,来自乌拉圭,你有办法让它发挥作用吗?