I've updated to MvvmCross version 4.2.1 from version 4.2.0 via NuGet and now the Android project crashes during startup. An MvxException
is thrown during the splash screen with the message:
MvvmCross.Platform.Exceptions.MvxException: You must call EnsureLoaded on the File plugin before using the DownloadCache
I actually am calling this method in MvxAppCompatSetup.InitializeLastChance
override. This worked well for me with version 4.2.0, but now the code doesn't even hit InitializeLastChance
when running version 4.2.1.
protected override void InitializeLastChance()
{
base.InitializeLastChance();
MvvmCross.Plugins.File.PluginLoader.Instance.EnsureLoaded();
MvvmCross.Plugins.DownloadCache.PluginLoader.Instance.EnsureLoaded();
}
I can't move the EnsureLoaded
calls to InitializeFirstChance
because there I'll get an exception because plugins haven't yet been initialized
Failed to resolve type MvvmCross.Platform.Plugins.IMvxPluginManager
The MvxSetup.InitializePluginFramework
appears to be throwing this exception when InitializePluginFramework
is called.
NuGet displayed error messages for each plugin I have installed during the update:
[Failure] Could not file file '...\Project.Droid\Bootstap\XXXBootstrap.cs'
The files are definitely there and the package installs without reporting an error.
What is the correct way to handle this problem?
Try to remove DownloadCachePluginBootstrap.cs and FilePluginBootstrap.cs just leave manual setup inside InitializeLastChance(). It seems that there is a problem with loading order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With