5

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.

Gerry
  • 1,031
  • 1
  • 14
  • 30

7 Answers7

3

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

Daniel Luberda
  • 7,374
  • 1
  • 32
  • 40
1

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

Adrián Romero
  • 620
  • 7
  • 17
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/17906250) – IvanH Nov 10 '17 at 17:57
  • Thank you for your feednack, I'll provide more details. – Adrián Romero Nov 10 '17 at 18:30
  • 1
    [it was not me who down voted] Generally would prefer to not have to switch to older versions of libraries - does this mean FFImage has a bug? – Gerry Nov 14 '17 at 21:43
  • Yep, i has a bug, I found version 2.2.20 stable, works on android and iOS without throwing exceptions, regards – Adrián Romero Nov 14 '17 at 21:47
  • I cannot downgrade xamarin forms, must use 3+ – Gerry Jun 18 '18 at 14:46
1

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.

Dumber_Texan2
  • 840
  • 2
  • 12
  • 34
0

Means your linker has cut the poor ffimageloading lib from the compiled binary.. Change linker settings to "SDK only".

Nick Kovalsky
  • 5,378
  • 2
  • 23
  • 50
  • I found under Android Options, the "Linking" header and set to "Sdk Assemblies Only" but still crashes. I have switched to using PNGs for now. – Gerry Nov 14 '17 at 21:41
0

I same problem. I updated Xamarin.Form to version 2.5 and removed all bin/obj folders. It solved.

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

0

Don't use the version 2.2.23 to 2.2.25. Use the 2.2.22. This is very stable and also has the latest features. Hope this helps.

Devlin Duldulao
  • 126
  • 2
  • 3
0

Use FFImageLoading 2.4.4.858-pre version.This version fix your error.

Tayfun
  • 11
  • 3