We have spent the last few weeks building the MAUI app based on Asp Net Zero V13.4.0. On emulators and physical devices when we debug the app, everything works great. When we set the app to deploy to the iOS app store and Testflight, the app just shows the spinning icon and never shows any actual screens or error messages. Thinking there may be an issue with 13.4.0, we upgraded to 14.1.0 and tried to deploy the base mobile app with no changes. On load through Testflight, the app immediately crashes. We wrapped some code around the MauiProgram.cs to catch any errors, and this is what we received:
Startup exception: System.TypeInitializationException: The type initializer for 'Abp.Dependency.IocManager' threw an exception.
---> Castle.MicroKernel.KernelException: Could not instantiate custom activator
---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) object object:lambda_method1 (System.Runtime.CompilerServices.Closure,object[])' while running in aot-only mode. See https://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
at System.Delegate.CreateDelegate(Type , Object , MethodInfo , Boolean , Boolean )
at System.Reflection.Emit.DynamicMethod.CreateDelegate(Type , Object )
at System.Linq.Expressions.Compiler.LambdaCompiler.CreateDelegate()
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression )
at System.Linq.Expressions.Expression`1[[System.Func`2[[System.Object[], System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Compile()
at Castle.Core.Internal.ReflectionUtil.BuildFactory(ConstructorInfo ctor)
at System.Collections.Concurrent.ConcurrentDictionary`2[[System.Reflection.ConstructorInfo, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Func`2[[System.Object[], System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetOrAdd(ConstructorInfo , Func`2 )
at Castle.Core.Internal.ReflectionUtil.Instantiate(ConstructorInfo , Object[] )
at Castle.Core.Internal.ReflectionUtil.Instantiate[IComponentActivator](Type , Object[] )
at Castle.Core.Internal.ReflectionUtil.CreateInstance[IComponentActivator](Type , Object[] )
at Castle.MicroKernel.DefaultKernel.CreateComponentActivator(ComponentModel )
--- End of inner exception stack trace ---
at Castle.MicroKernel.DefaultKernel.CreateComponentActivator(ComponentModel )
at Castle.MicroKernel.Handlers.DefaultHandler.InitDependencies()
at Castle.MicroKernel.Handlers.AbstractHandler.Init(IKernelInternal )
at Castle.MicroKernel.Handlers.DefaultHandlerFactory.Create(ComponentModel )
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.CreateHandler(ComponentModel )
at Castle.MicroKernel.DefaultKernel.AddCustomComponent(ComponentModel )
at Castle.MicroKernel.Registration.ComponentRegistration`1[[Abp.Dependency.IocManager, Abp, Version=10.1.0.0, Culture=neutral, PublicKeyToken=null]].Castle.MicroKernel.Registration.IRegistration.Register(IKernelInternal )
at Castle.MicroKernel.DefaultKernel.Register(IRegistration[] )
at Castle.Windsor.WindsorContainer.Register(IRegistration[] )
at Abp.Dependency.IocManager..ctor()
at Abp.Dependency.IocManager..cctor()
--- End of inner exception stack trace ---
at Abp.Dependency.IocManager.get_Instance()
at Abp.AbpBootstrapperOptions..ctor()
at Abp.AbpBootstrapper..ctor(Type , Action`1 )
at Abp.AbpBootstrapper.Create[OurNawAppMauiModule](Action`1 )
at OurNawApp.Maui.Core.ApplicationBootstrapper.InitializeIfNeeds[OurNawAppMauiModule]()
at OurNawApp.Maui.MauiProgram.CreateMauiApp()
In 13.4.0 the app just spins. We even set it back to a clean version of the app (none of our code) and still have the same issue. We did not try to catch any errors in this version.
In 14.1.0, it immediately crashes with the provided error. It appears to be caused by iOS AOT compilation. This was also done by a clean version of the app (none of our code).
2 Answer(s)
-
0
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) OurNawApp.ApiClient.Models.AbpAuthenticateResultModel object:Thunk1ret_AbpAuthenticateResultModel_Object_AbpAuthenticateResultModel_ResolutionContext (System.Func2<object[], object>,object,OurNawApp.ApiClient.Models.AbpAuthenticateResultModel,AutoMapper.ResolutionContext)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
Could you try this solution https://support.aspnetzero.com/QA/Questions/10372/Xamarin-on-iOS-Build-Error#answer-2fc26bfc-2050-9aa3-be89-39feccd4cb3e ? If it doesn't work, could you create an issue on https://github.com/aspnetzero/aspnet-zero-core/issues ? We will investigate it further.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)