我正在通过ikvm-monotouch和 MonoTouch 将 Java 游戏移植到 iOS。我遇到了一个让我有点头疼的错误,虽然我不确定这是否是 MonoTouch 中的实际错误,所以我在点击错误数据库之前在这里询问。
在反映对象字段的方法期间,我收到下面的 JIT 编译错误。我(到目前为止)只在反映实现的对象时看到此错误Cloneable
,尽管我不确定这是否是触发此错误的具体原因。
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for ikvm.internal.ClassLiteral`1 ---> System.ExecutionEngineException: Attempting to JIT compile method 'ikvm.internal.ClassLiteral`1<java.lang.Cloneable>:.cctor ()' while running with --aot-only.
--- End of inner exception stack trace ---
at System.Reflection.MonoField.GetValue (System.Object obj) [0x0006a] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoField.cs:124
at IKVM.Internal.TypeWrapper.LazyInitClass () [0x00063] in /Users/nathan/projects/ikvm-monotouch-git/runtime/TypeWrapper.cs:1841
at IKVM.Internal.TypeWrapper.get_ClassObject () [0x00027] in /Users/nathan/projects/ikvm-monotouch-git/runtime/TypeWrapper.cs:1756
at IKVM.NativeCode.java.lang.Class.getInterfaces (java.lang.Class thisClass) [0x0001c] in /Users/nathan/projects/ikvm-monotouch-git/runtime/openjdk.cs:2556
at java.lang.Class.getInterfaces () [0x00000] in <filename unknown>:0
at java.lang.Class.privateGetPublicFields (Set ) [0x00000] in <filename unknown>:0
at java.lang.Class.privateGetPublicFields (Set ) [0x00000] in <filename unknown>:0
at java.lang.Class.getFields (ikvm.internal.CallerID ) [0x00000] in <filename unknown>:0
ikvm-monotouch TypeWrapper 类的快速链接:https ://github.com/samskivert/ikvm-monotouch/blob/master/runtime/TypeWrapper.cs