Default constructor not found for type MvxPropertyInjector

I'm using MvvmCross and Xamarin Support libraries in my project and, after I updated MvvmCross from version 4.2.0 to 4.4.0 and Xamarin Support Packages from version 23.3.0 to 25.1.1, I can't execute the project. The app always crash in SplashScreen with error: Default constructor not found for type MvvmCross.Platform.IoC.MvxPropertyInjector. The error occurs in debug mode and release mode.

My 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);
        }
    }

Upvotes: 1

Views: 1266

Answers (1)

Cheesebaron
Cheesebaron

Reputation: 24460

Add the following to your LinkerPleaseInclude file:

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

You might need other hints for the linker not to not throw away code that is only invoked through Reflection.

Upvotes: 1

Related Questions