You must call EnsureLoaded on the File plugin before using the DownloadCache #119
Description
The update from 4.2.0 to 4.2.1 seems to sometimes cause issues if the project uses the DownloadCache and File plugins. When this happens an exception is thrown during setup
You must call EnsureLoaded on the File plugin before using the DownloadCache
During the update NuGet shows an error claiming the various Bootstrap
files can not be found. The files are present and have not been modified from the originals. It's not clear to me why NuGet can't see these files.
I've asked about this on Stackoverflow.
It seems like the DownloadCache plugin has a dependency on the File plugin but the DownloadCache is loaded before the File plugin has been loaded.
One workaround is to manually remove the DownloadCache and File bootstrap loaders, then manually call EnsureLoaded on the plugins in the correct order:
protected override void InitializeLastChance()
{
base.InitializeLastChance();
MvvmCross.Plugins.File.PluginLoader.Instance.EnsureLoaded();
MvvmCross.Plugins.DownloadCache.PluginLoader.Instance.EnsureLoaded();
}
Steps to reproduce
- Update from 4.2.0 to 4.2.1 via NuGet.
- Run the project.
- An exception is thrown during setup.
Expected behavior
The plugins should load automatically in the correct order.
Actual behavior
An exception is thrown during setup.
Configuration
Version: 4.2.1
Platform: Android