System.TypeLoadException: Could not resolve type with token 01000019

Same error for me.

Problem:

I had different versions of the Xamarin.Forms package in my solution.

Solution:

Change in your Core, Droid and IOS project the Xamarin.Forms versions. Make sure that all versions are the same.

I hope this works.


Here is the complete solution

  1. Install nuget package https://www.nuget.org/packages/sameerIOTApps.Plugin.SecureStorage/
  2. Create SecureStorageLinkerOverride.cs in Droid project

    using System;
    using Plugin.SecureStorage;
    
    namespace MyApp.Droid
    {
        public static class LinkerPreserve
        {
            static LinkerPreserve()
            {
                throw new Exception(typeof(SecureStorageImplementation).FullName);
            }
        }
    
    
        public class PreserveAttribute : Attribute
       {
       }
    
    }
  3. Right click on Droid Project -> Property -> Android Option-> Linker -> "SDK Assemblies Only"

Now run your project. Comment bellow for any issues else marked it answer.


In Visual Studio 2015, running the project in Release Mode have no issues (if you don't change the default settings)

In Debug mode by selecting Linking: "SDK Assemblies Only" in Project Properties -> Android Options -> Linker, will run the project without problems.

Or just simply leave those Debug settings and add a file called "SecureStorageLinkerOverride.cs" in the Android project:

using System;
using Plugin.SecureStorage;

namespace MyApp.Droid
{
    public static class LinkerPreserve
    {
        static LinkerPreserve()
        {
            throw new Exception(typeof(SecureStorageImplementation).FullName);
        }
    }

    public class PreserveAttribute : Attribute
    {
    }

}