找不到类型为MvxPropertyInjector的默认构造函数

时间:2017-02-17 12:14:39

标签: xamarin xamarin.android mvvmcross

我在我的项目中使用MvvmCross和Xamarin支持库,在我将MvvmCross从版本4.2.0更新到4.4.0并将Xamarin支持包从版本23.3.0更新到25.1.1后,我无法执行项目。应用程序始终在SplashScreen中崩溃并出现错误:找不到类型为MvvmCross.Platform.IoC.MvxPropertyInjector的默认构造函数。在调试模式和释放模式下发生错误。

我的SplashScreen:

[Activity(Icon = "@drawable/ic_launcher",
        Theme = "@style/InflorTheme.Splash",
        NoHistory = true,
        MainLauncher = true,
        ScreenOrientation = ScreenOrientation.Portrait)]
    public class SplashScreen : MvxSplashScreenActivity
    {
        protected override void OnCreate(Bundle bundle)
        {

               base.OnCreate(bundle);
        }
    }

1 个答案:

答案 0 :(得分:1)

将以下内容添加到LinkerPleaseInclude文件中:

public void Include(MvvmCross.Platform.IoC.MvxPropertyInjector injector)
{
    injector = new MvvmCross.Platform.IoC.MvxPropertyInjector();
}

您可能需要链接器的其他提示,不要丢弃仅通过Reflection调用的代码。

相关问题