title: System.TypeLoadException: Could not resolve type with token 01000019
body: <p>I have a Xamarin.Forms solution which contains in each project (Android, iOS and Windows 8.1) a lib called Plugin.SecureStorage from here:
  <a href="https://github.com/sameerkapps/SecureStorage">https://github.com/sameerkapps/SecureStorage</a>
  I installed it via NuGET in each project.</p>
  
  <p>Everything works fine in iOS and Windows 8.1, the problem is in Android. The project in Android builds correctly, however at startup I get this:</p>
  
  <pre><code>[...]
  Loaded assembly: MonoDroidConstructors [External]
  09-27 18:14:49.880 D/Mono    (30329): Assembly Ref addref AppConsume.Droid[0xb8cb0608] -&gt; mscorlib[0xb8c64bc0]: 23
  09-27 18:14:49.890 D/Mono    (30329): Assembly Ref addref Xamarin.Forms.Core[0xb8cbca58] -&gt; System.Collections[0xb8cc5980]: 3
  09-27 18:14:49.900 D/Mono    (30329): Assembly Ref addref Xamarin.Forms.Core[0xb8cbca58] -&gt; System.Threading[0xb8cd4948]: 3
  09-27 18:14:49.930 D/Mono    (30329): Assembly Ref addref AppConsume.Droid[0xb8cb0608] -&gt; Plugin.SecureStorage[0xb8cb43f8]: 2
  Unhandled Exception:
  
  System.TypeLoadException: Could not resolve type with token 01000019
  </code></pre>
  
  <p>What it does mean? is a bit cryptic to me. How can I resolve this problem?</p>
  
  <p>Of course, as a requirement, I added this line...</p>
  
  <pre><code>SecureStorageImplementation.StoragePassword = "mypass";
  </code></pre>
  
  <p>in the MainActivity.cs of the Android project...</p>
  
  <pre><code>using System;
  
  using Android.App;
  using Android.Content.PM;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Android.OS;
  using Plugin.SecureStorage;
  
  namespace MyApp.Droid
  {
      [Activity(Label = "MyApp", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
      public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
      {
          protected override void OnCreate(Bundle bundle)
          {
              base.OnCreate(bundle);
              SecureStorageImplementation.StoragePassword = "mypass";
              global::Xamarin.Forms.Forms.Init(this, bundle);
              LoadApplication(new App());
          }
      }
  }
  </code></pre>
  
  <p>I also found that changing the line position throws different 'token types' in the exception.</p>
  
  <p><strong>UPDATE:</strong> I just found the app runs sucessfully when compiling in <strong>Release Mode</strong>. However, not working in Debug mode is a problem that I would like to fix I don't think that is out of scope of this question.</p>