sameerkapps / SecureStorage

119 stars 32 forks source link

System.TypeLoadException: Could not resolve type with token #21

Closed dagostinelli closed 6 years ago

dagostinelli commented 6 years ago

I'm new to the lib and didn't spend much time trying to use it. I installed it from NuGet into my PCL, my Droid and my iOS projects, then added this line to the MainActivity.cs and ran the app.

protected override void OnCreate(Bundle bundle)
{
   base.OnCreate(bundle);
   ...
   global::Xamarin.Forms.Forms.Init(this, bundle);
   SecureStorageImplementation.StoragePassword = "Your Password";
   ...
   LoadApplication(new App());
}

It crashes immediately with:

09-14 14:05:16.574 E/mono    (10534): 
09-14 14:05:16.574 E/mono    (10534): Unhandled Exception:
09-14 14:05:16.574 E/mono    (10534): System.TypeLoadException: Could not resolve type with token 0100003c (from typeref, class/assembly Plugin.SecureStorage.SecureStorageImplementation, Plugin.SecureStorage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
09-14 14:05:16.579 E/mono-rt (10534): [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not resolve type with token 0100003c (from typeref, class/assembly Plugin.SecureStorage.SecureStorageImplementation, Plugin.SecureStorage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
sameerkapps commented 6 years ago

You may also need to add it to your android project. Please check the latest version.

mbausdorf commented 6 years ago

I get the same issue. The project reference is added to Android project and the PCL projects. System.TypeLoadException: Could not resolve type with token 01000143