Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFImageLoading: Unhandled Exception: System.TypeLoadException: Could not load list of method overrides occurred

When trying to init FFImage (in my application):

CachedImageRenderer.Init();

I get the mysterious error:

Unhandled Exception:  System.TypeLoadException: Could not load list of method overrides occurred

I can get the FFImage sample app to run okay. I have the dependencies all in order as far as I can tell.

like image 355
Gerry Avatar asked Nov 09 '17 21:11

Gerry


3 Answers

I'm an author of this library. I forgot to raise Xamarin.Forms dependency to 2.4.x version (planned for next release).

If using Xamarin.Forms < 2.4 you want to use v2.2.25-legacy prerelease package version. I stripped fast renderer out of it.

https://github.com/luberda-molinet/FFImageLoading/issues/814#issuecomment-344677274

like image 139
Daniel Luberda Avatar answered Jan 01 '23 09:01

Daniel Luberda


I have to downgrade nuget packages to 2.2.20 see this:

https://github.com/luberda-molinet/FFImageLoading/issues/788

I hope this helps you


EDIT:

I tried FFImageLoading version 2.2.24 with xamarin forms 2.0.4.280, in iOS it works like a charm, but in android it gives me that exception (FFImageLoading: Unhandled Exception: System.TypeLoadException: Could not load list of method overrides occurred).

So how I get arround this ? just downgrade xamarin forms to previous version (2.3.4.224) and set FFImageLoading nuget package to 2.2.20

PD: Excuse my poor english

like image 28
Adrián Romero Avatar answered Jan 01 '23 09:01

Adrián Romero


I had this issue in Android when I tried to use 2.2.25 in both the Portable and the Droid Project. The fix was to use 2.2.19 in the Droid Project.

Portable

Xamarin.FFImageLoading version="2.2.25"
Xamarin.FFImageLoading.Forms version="2.2.25" 

Droid Forms app

Xamarin.FFImageLoading version="2.2.19"
Xamarin.FFImageLoading.Forms version="2.2.19" 

I am using Xamarin.Forms version="2.5.1.444934" and compiling with Android 8.1 (Oreo). I'm also using Xamarin.FFImageLoading.Transformations version="2.2.9".

I have no idea why, but it works. Hope this helps someone else.

like image 42
Dumber_Texan2 Avatar answered Jan 01 '23 08:01

Dumber_Texan2