Search code examples
xamarin.formscircleimage

Xamarin Forms:ImageCircle package is not working in release mode UWP


For the circle image, I am using Xam.Plugins.Forms.ImageCircle package and it is working fine in debug mode.

But in release mode, all the pictures are in square format. I uninstall and reinstall the nuget. Also, do clean, rebuild and deleting bin and obj folders, but still the issue is not resolved.

Thanks in advance


Solution

  • You might be running into this piece of the documentation.

    For linking you may need to add:

    Android:

    ImageCircle.Forms.Plugin.Abstractions;ImageCircle.Forms.Plugin.Android;

    iOS:

    --linkskip=ImageCircle.Forms.Plugin.iOS --linkskip=ImageCircle.Forms.Plugin.Abstractions

    Add this to your platform project build options.

    Android

    Add linking skip on Android

    iOS

    Add linking skip on iOS

    You should only need to add this on the Release configuration.

    For UWP, you just have to create a small, trivial reference to the CircleImage assembly to keep it included in a release build. Add this piece of code above the Xamarin.Forms Init line:

    var rendererAssemblies = new[]
    {
        typeof(ImageCircleRenderer).GetTypeInfo().Assembly
    };
    Xamarin.Forms.Forms.Init(e, rendererAssemblies);