IMvxAppStart related crash with Application.OnCreate overridden

点点圈 提交于 2019-12-06 15:38:34

问题


The error:

MvvmCross.Exceptions.MvxIoCResolveException: Failed to resolve type MvvmCross.ViewModels.IMvxAppStart occurred

when tried to override Application.OnCreate

[Application]
public class RemoteApplication : MvxAndroidApplication<Setup, Core.App>
{
    public RemoteApplication(IntPtr reference, JniHandleOwnership transfer) :
        base(reference, transfer) { }

    public override void OnCreate()
    {
        base.OnCreate();
    }
}

回答1:


It was fixed by @Martijn00 advice from Similar Question

public override void OnCreate()
{
    MvxAndroidSetupSingleton
        .EnsureSingletonAvailable(ApplicationContext)
        .EnsureInitialized();

    base.OnCreate();
}

6.2.3
MvvmCross update from 6.2.2 to 6.2.3 fixed the crash, but the app stuck on Splash Screen then. So only EnsureInitialized() fixed it entirely.



来源:https://stackoverflow.com/questions/54690561/imvxappstart-related-crash-with-application-oncreate-overridden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!