FFImageLoading: Init exception with latest Xamarin.Forms 3.4 / 3.6

Description

I updated the Xamarin.Forms NuGet Package to the latest version and now I get an exception on OnCreate in Android (iOS untested so far).

Actual Behavior

Unhandled Exception:

System.TypeLoadException: VTable setup of type FFImageLoading.Forms.Platform.CachedImageFastRenderer failed

Basic Information

  • Version with issue: 2.4.3.840 with XF v3.4.0.1008975
  • Last known good version: 2.4.3.840 with XF v3.3.0.967583
  • Platform: Android, not sure about iOS

Reproduction Link / Code

In MainActivity, in OnCreate(), it happens on this line: FFImageLoading.Forms.Platform.CachedImageRenderer.Init(enableFastRenderer: true);

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 55
  • Comments: 144 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Please check 2.4.5.870-pre. Cheers.

@daniel-luberda

It’s definitely FFImageLoading that fails

image

Same issue on XF 3.6.0.264807 and latest stable of FFImageloading

Thanks! Meanwhile v2.4.3.840 seems to be working. XF v3.6.0.220655 FFIL v2.4.3.840

I can also confirm the above - 2.4.5.870-pre and XF 3.6.0.264807 are working. I’ll leave it here pending formal release of the next FFImageLoading version.

@daniel-luberda

Still seeing this issue in the release that just went out

11-16 14:06:02.954 D/Mono    (18252): DllImport attempting to load: '/system/lib/liblog.so'.
11-16 14:06:02.954 D/Mono    (18252): DllImport loaded library '/system/lib/liblog.so'.
11-16 14:06:02.964 D/Mono    (18252): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
11-16 14:06:02.964 D/Mono    (18252): Searching for '__android_log_print'.
11-16 14:06:02.964 D/Mono    (18252): Probing '__android_log_print'.
11-16 14:06:02.964 D/Mono    (18252): Found as '__android_log_print'.
11-16 14:06:02.994 I/MonoDroid(18252): UNHANDLED EXCEPTION:
11-16 14:06:03.104 I/MonoDroid(18252): System.TypeLoadException: Could not load list of method overrides due to Method not found: void Xamarin.Forms.Platform.Android.IVisualElementRenderer.add_LayoutChange(System.EventHandler`1<Android.Views.View/LayoutChangeEventArgs>)
11-16 14:06:03.104 I/MonoDroid(18252):   at HamburgerMenu.Droid.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x00037] in D:\Dev\Hamburger\New UX Components Test\Droid\MainActivity.cs:24 
11-16 14:06:03.104 I/MonoDroid(18252):   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 
11-16 14:06:03.104 I/MonoDroid(18252):   at (wrapper dynamic-method) System.Object.7(intptr,intptr,intptr)
11-16 14:06:03.134 W/art     (18252): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
11-16 14:06:03.144 D/Mono    (18252): DllImport searching in: '__Internal' ('(null)').
11-16 14:06:03.144 D/Mono    (18252): Searching for 'java_interop_jnienv_throw'.
11-16 14:06:03.144 D/Mono    (18252): Probing 'java_interop_jnienv_throw'.
11-16 14:06:03.144 D/Mono    (18252): Found as 'java_interop_jnienv_throw'.
Unhandled Exception:

System.TypeLoadException: Could not load list of method overrides due to Method not found: void Xamarin.Forms.Platform.Android.IVisualElementRenderer.add_LayoutChange(System.EventHandler`1<Android.Views.View/LayoutChangeEventArgs>)

FFImageLoading 2.4.4.859 Visual Studio: 17.9 Android Support: 27.0.2.1 Forms: 3.3.0/3.4.0

Deleted all obj&bin and cleared nuget cache.

Hi, I can confirm I get the same init exception with Xamarin.Forms 3.6 and 2.4.5 pre.

Hi

Using 2.4.5.909-pre (Core, iOS and Android) and Xamarin forms 3.6.0.344457 but the images are not visible.

I pushed quite a lot of fixes and improvements lately. New prerelease package should be a lot more performant, especially on Android. I tested it while fast scrolling tons of images (also with poor internet connection scenario), not a single crash or exception and memory usage is lower than with previous versions. SVG parsing is also improved, etc.

I plan to release new stable. If you could test prerelease first and submit your feedback I would be grateful as I would like to fix all potential issues before a release.

After some research, the problem is related to Xamarin.Forms.Visual.Material!

When the CachedImage or SvgCachedImage are inside a, for example, StackLayout which has the property Visual=“Material”, then you take an exception.

I set, for CachedImage, the property Visual=“Default” and everything works fine!

(XF 3.6.0.293080, XF Visual Material 3.6.0.293080, Xamarin.FFImageLoading.Svg.Forms 2.4.5.880-pre, VS2019)

BR.

Please check 2.4.5.870-pre. Cheers.

Works fine with XF: 3.6.0.220655 Thanks for the fixes and continuous support of this package!

this is using XF 3.6.0.220655 and FF 2.4.4.859 and PRE version image

@daniel-luberda, a BIG THANK for removing FATAL Error. All good with VS 17.9.1, XF 3.4 except my image resolution issue that I talked about …

Appreciate your help in making us look good. Many paid vendors struggle to reach this bar and level of understanding to serve their customers.

A big Applaud for your professionalism. Thank you !

image

@daniel-luberda 2.4.4.858-pre fixes the issue.

Using version 2.4.4.859 works well with XForms 3.4.0.1009. The following versions did not work for me (combined with the same XForms version above):

  • 2.4.11.982
  • 2.4.9.961

@PureWeen as mentioned above https://github.com/luberda-molinet/FFImageLoading/issues/1154#issuecomment-480989539, with the version 2.4.5.880-pre is not loading svg files for me

Works well with 2.4.5.870-pre and XF 3.6.0.264807. Thank you all.

It works after installing the 2.4.5.870-pre version, Thanks for that

I think that downgrading is not a good solution. we had several fixes between those versions.

@mazhiyuan1981 Either downgrade XF to latest 3.5.x or downgrade ff image to 2.4.3.840 for awhile, as this worked on my end. They might push a new version for ffimage to fix the issue.

use CachedImageRenderer.Init(true); at OnCreate(Bundle savedInstanceState)

Unhandled Exception:

System.TypeLoadException: Could not load list of method overrides due to Method not found: void Xamarin.Forms.Platform.Android.IVisualElementRenderer.add_LayoutChange(System.EventHandler`1<Android.Views.View/LayoutChangeEventArgs>)

xamarin.forms version:3.6.0.220665

oh my god… help me…

I can’t live without FFImageLoading.

当使用xf版本:3.6.0.220665时,报错,请大家帮助我。谢谢各位。

@mjspk

Now that Forms has rolled back the interface a new 2.4.5 pre version of FFImageLoading will need to be released. Once that’s released then it’ll fix the exception

Same same error here for Xamarin.Forms 3.6 and 2.4.5 pre

@mackayn Hi, I tested it on Mac VS 7.7 but I don’t see anything related to FFImageLoading in the given stack trace. Are you sure it’s FFImageLoading? Maybe it’s other lib?

I didn’t make any fix for XF 3.4 - I only rebuild it with XF packages updates. Maybe VS is caching those files somewhere?

@IoTFier Stable is released already

@mackayn I tried this already, I deleted all FFIL packages in the packages folder C:\Users\UserName\.nuget\packages\ but the problem still exists, I will compile source code locally.

See screenshot above, it works. I just tested it on FFIL sample project:

Screenshot_1555936745

@kmagalios We could use a fix for this, see: #1246 Reflection is needed as we need to be backward compatible. What do you think? Can you confirm if non-default style is an issue?

@daniel-luberda I’ve installed the latest preview version (2.4.5.900-pre) and everything works fine. I remove the property Visual=“Default” and everything is ok.

Thank you.

@daniel-luberda It seems that some images that were displayed correctly using the old version can’t be displayed with the new one. I created a sample that demonstrates that In this sample I display two images using the old version (2.3.6) and the other use the pre-release version (2.4.5.900), the old sample display both images correctly but the new one display only one image and the other is white.

Yes, 2.4.5.870-pre and XF 3.6.0.264807 is good for me.

Same here

Well, but we need it working on stable releases.

Updated from XF 3.4 to 3.6 today and got this error. For me FFIL 2.4.5.870-pre solved the problem. Using VS 15.9.7

I’m having the same issue here. Downgrading to 2.4.3.840 solved, even being a weird solution.

@jbtamaresgit downgrade ff to 2.4.3.840 worked for me

I can only use it by rolling back to the previous version(xf:3.5.0.169047). But this is not a good idea.

我现在只能通过回滚到上一个版本(xf:3.5.0.169047),才能使用。但这不是好办法。

@daniel-luberda FYI, 3.6.0 is stable now and contains the fixed API, so it’s ready for a rebuild. Thanks!!!

I clean All projects and Rebuild the solution and fixed for me

I had I use xamarin forms 3.4.0.1029999 and ffimageloading 2.4.4.859

I have the same issue too using XF 3.4.0.1008975 VS 17 15.9.3 Minimum API level 5.0 Target level Android 8.0 FFImageLoading 2.4.4.859 Oneplus 3 running android 7.1

I update to XF 4.0.0.8055-pre FFImageLoading 2.4.5.860-pre its working now

Update : Test with android 8.0 its working too

I had the same issue when I updated XF to 3.4. I solved it when I also updated FFImageLoading and FFImageLoading.Forms to the newest stable version. In addition, I had to delete bin und obj folders. Now it works.

Same issue here.