Ffimageloading: 2.4.4 Linker Error (Failed to resolve System.Void Xamarin.Forms.Platform.Android.IVisualElementRenderer::add_LayoutChange)

Created on 30 Nov 2018  路  10Comments  路  Source: luberda-molinet/FFImageLoading

Description

After updating from 2.4.3 to 2.4.4 or 2.5-preview, on building a Xamarin.Forms (v3.3.0.967583) project for Android, the linker throws an exception.

Expected Behavior

It should just build fine, like in version 2.4.3.

Actual Behavior

Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void FFImageLoading.Forms.Platform.CachedImageFastRenderer::Xamarin.Forms.Platform.Android.IVisualElementRenderer.add_LayoutChange(System.EventHandler`1<Android.Views.View/LayoutChangeEventArgs>)' in assembly: 'FFImageLoading.Forms.Platform.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Xamarin.Forms.Platform.Android.IVisualElementRenderer::add_LayoutChange(System.EventHandler`1<Android.Views.View/LayoutChangeEventArgs>)
   at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   --- End of inner exception stack trace ---
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() Rotarex.DIMES.Droid     

Basic Information

  • Version with issue: 2.4.4 or newer
  • Last known good version: 2.4.3
  • Platform: Xamarin.Forms / Android (v3.3.0.967583)

Most helpful comment

It's fixed in newest prerelease.

All 10 comments

Same behaviour with Xamarin.Forms 3.3.0.967583 and FFImageLoading 2.4.4.859

I had the same issue & a quick temporary fix is to downgrade the version used to a previous working one. For me, It was 2.4.3.840. Just unload your projects & directly edit the csproj files.

<ItemGroup> <PackageReference Include="Xamarin.FFImageLoading" Version="2.4.3.840" /> <PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.3.840" /> </ItemGroup>

Downgrading to 2.4.3.840 worked for me as well, I was using 2.4.4.859 and got the same error as OP.

I have the same issue with XF 3.6.0.220655 I fixed by disable linking

I have the same issue with XF 3.6.0.220655 I fixed by disable linking

Isn't this not recommended for Release?

It's fixed in newest prerelease.

I have the same problem with Xamarin Forms 3.6.0.220655 and FFImageLoading 2.4.4.859

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)

here is my MainActivity.OnCreate :

    protected override void OnCreate(Bundle bundle)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;

        this.Window.AddFlags(WindowManagerFlags.Fullscreen);

        base.OnCreate(bundle);
        Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, bundle);

        global::Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental");

        CachedImageRenderer.Init(true);

        var config = new FFImageLoading.Config.Configuration()
        {
            VerboseLogging = false,
            VerbosePerformanceLogging = false,
            VerboseMemoryCacheLogging = false,
            VerboseLoadingCancelledLogging = false,
            Logger = new CustomLogger(),
        };
        FFImageLoading.ImageService.Instance.Initialize(config);

        global::Xamarin.Forms.Forms.Init(this, bundle);

        AndroidAppLinks.Init(this);

        LoadApplication(new YApp());

        FirebasePushNotificationManager.ProcessIntent(this, Intent);
    }

everything looks allright, in fact the App was working untill I updated the xamarin Forms And Xamarin.Android NuGets

I have the same too, using latest version of XF and FF. I was on 3.4 and upgrading to 3.6 breaks the Android compilation.

It's fixed in newest prerelease.

Can you specify the version?

It's fixed in newest prerelease.

Can you specify the version?

@rohitvipin I upgraded to 2.4.5.870-pre and the issue was fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jjchiw picture jjchiw  路  5Comments

JeremyBP picture JeremyBP  路  5Comments

PostImpatica picture PostImpatica  路  4Comments

CNDOGTA picture CNDOGTA  路  3Comments

thisisthekap picture thisisthekap  路  5Comments