gpt4 book ai didi

ios - Xamarin 4 issue : iOS AOT problems which are not present in Xamarin 3. 怎么解决?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:11:04 25 4
gpt4 key购买 nike

我在 Mac 上使用最新的 Xamarin 4 工具(Xamarin Studio 5.10.1、Xamarin iOS 9.2.1、Mono MDK 4.2.1)和最新的 Xamarin 3 构建了完全相同的代码库(Xamarin Studio 5.9.8.0、Xamarin.iOS 9.1.0.31、Mono MDK 4.0.5.1)工具。

Xamarin 3 构建工作正常,Xamarin 4 则不行。这是 MS ADAL 库产生的 AOT 问题:

System.ExecutionEngineException: Attempting to JIT compile method 
'(wrapper runtime-invoke) <Module>:runtime_invoke_bool_Nullable`1<DateTimeOffset> (object,intptr,intptr,intptr)'
while running with --aot-only.
See http://docs.xamarin.com/ios/about/limitations for more information.

以及完整的堆栈跟踪:

System.Reflection.MonoMethod.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
System.Reflection.MethodBase.Invoke(object obj, object[] parameters)
System.Runtime.Serialization.Json.JsonFormatWriterInterpreter.UnwrapNullableObject(Func<_> memberValue, ref Type memberType, ref bool isNull)
System.Runtime.Serialization.Json.JsonFormatWriterInterpreter.WriteValue(Type memberType, object memberValue)
System.Runtime.Serialization.Json.JsonFormatWriterInterpreter.WriteMembers(ClassDataContract classContract, ExtensionDataObject extensionData, ClassDataContract derivedMostClassContract)
System.Runtime.Serialization.Json.JsonFormatWriterInterpreter.WriteClass(ClassDataContract classContract)
System.Runtime.Serialization.Json.JsonFormatWriterInterpreter.WriteToJson(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, ClassDataContract dataContract, XmlDictionaryString[] memberNames)
System.Runtime.Serialization.Json.JsonFormatWriterGenerator.CriticalHelper.<GenerateClassWriter>c__AnonStorey0.<>m__0(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, ClassDataContract dataContract, XmlDictionaryString[] memberNames)
System.Runtime.Serialization.Json.JsonClassDataContract.WriteJsonValueCore(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
System.Runtime.Serialization.Json.JsonDataContract.WriteJsonValue(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
System.Runtime.Serialization.Json.DataContractJsonSerializer.WriteJsonValue(JsonDataContract contract, XmlWriterDelegator writer, object graph, XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
System.Runtime.Serialization.Json.XmlObjectSerializerWriteContextComplexJson.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle)
System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle)
System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
System.Reflection.MonoMethod.InternalInvoke(MonoMethod, object, object[], ref Exception)(wrapper managed-to-native)
System.Reflection.MonoMethod.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__68.MoveNext()
Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__4b.MoveNext()

我将不胜感激对发生了什么变化以及为什么这个东西不再起作用的任何建设性解释。

这是否与某些 Mono 实现更改或某些奇怪的 mtouch 行为有关?

最佳答案

解决方案:请在 http://bugzilla.xamarin.com 上提交错误报告,以及一个测试用例。 stackoverflow 上的任何人都可以帮助解决此类特定问题的可能性很小。

至于为什么?很可能从 Mono 代码(XI 9.1 中使用了 mono 4.0)到 MS RS 代码(mono 4.2 和 XI 9.2 中使用的开源 .NET BCL)的转变遇到了 AOT 编译器无法处理的情况。

测试用例将帮助我们识别和修复该代码。更重要的是,它还对我们的单元测试做了很好的补充(以确保进一步的更改不会再次破坏它)。

关于ios - Xamarin 4 issue : iOS AOT problems which are not present in Xamarin 3. 怎么解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34076434/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com