Cannot display image when using Android

Help?  I must be doing something wrong but cannot see it.


I'm using the SfImageEditor in my MAUI app for IOS and Android - version 28.2.9

On iOS the component works perfectly when I'm loading images from Resource folder, local file path and remote URI, I can display and edit imagery 100%. 

However, on Android, I cannot get an image to display using any method even the most most basic content page (see below), I only see an empty sfImageEditor component in the UI.  I've tried on different Android Emulators and physical Android devices.  There are no exception thrown, nada.

What am I doing wrong, is there some Android config I'm missing?

Cheers,
Iain


<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:sf="http://schemas.syncfusion.com/maui"

Shell.BackgroundColor="{StaticResource PrimaryColor}"
Shell.TitleColor="{StaticResource Light}"
Shell.ForegroundColor="{StaticResource Light}"
Title="Photo">

<ContentPage.Content>
<sf:SfImageEditor
x:Name="MyImageEditor"
Source="https://picsum.photos/200/300" >
</sf:SfImageEditor>

</ContentPage.Content>
</ContentPage>

11 Replies 1 reply marked as answer

VM Vidyalakshmi Mani Syncfusion Team March 12, 2025 01:59 PM UTC

Hi Iain ,


Thank you for reaching out. We tested the reported issue on Android, and the images were loaded into the image editor without any issues. We’ve attached the sample we used for testing.  


Kindly check with our sample on your end and let us know if the issue persists. If you still encounter the problem, please provide the following details to help us investigate further:  


- The version of the Microsoft.Maui.Controls NuGet package in your project.  

- Are you using on .NET 8.0 or .NET 9.0 in your application?

- The Android device details (model and OS version) where the issue occurs.  


Regards,

Vidyalakshmi M.



Attachment: MauiImageEditor_96fa2fe5.zip


MK Martin Kammann April 3, 2025 10:52 PM UTC

Hi, I am experiencing the same. 

Using:

  • .net 9
  • Microsoft.Maui.Controls Version 9.0.40
  • Tried both V28 (28.2.6) and V29 (29.1.35) of Syncfusion.Maui.ImageEditor
  • Not working on any Android device or emulator. But try Pixel Tablet -- API 35 Android 15.0 for reference
The interesting thing is, that image manipulation still works, e.g. I can flip and rotate, but all the while nothing is showing on the canvas.


IS Iain Stirzaker replied to Vidyalakshmi Mani April 4, 2025 09:48 AM UTC

Still NOT working

Setup:

  • .net 9
  • Microsoft.Maui.Controls Version 9.0.40
  • Tried both V28 (28.2.6) and V29 (29.1.35) of Syncfusion.Maui.ImageEditor
  • Android 34/35 on Jet Brains Rider Pixel Emulator / Samsung and Huawei physical devices


The control knows the image is there because you can manipulate it , but you just can't see it.  And also, you can save the image but it's always 0 bytes.

This is real pain for us as we can't launch the Android version of our app because of this issue.  It seems from the additional comment that other people have the same issue too.  Syncfusion: Please take another look.  



IS Iain Stirzaker replied to Martin Kammann April 4, 2025 09:50 AM UTC

I thought I was going mad, cheers for posting



VM Vidyalakshmi Mani Syncfusion Team April 4, 2025 01:21 PM UTC

Hi Iain and Martin,


Thank you for providing the details.


We have tested the MAUI SfImageEditor using Microsoft.Maui.Controls version 9.0.40 on Android emulators, specifically Pixel 5 (API 34, Android 14) and Pixel 7 (API 35, Android 15). In our testing, the image loads and renders correctly within the editor.


Kindly ensure that the following permissions are declared in your AndroidManifest.xml file:


 

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

               <application android:allowBackup="true" android:icon="@mipmap/appicon" android:usesCleartextTraffic="true" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>

               <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

               <uses-permission android:name="android.permission.INTERNET" />

</manifest>

 

 


For your reference, we have attached a tested sample along with an output video. Kindly check if the issue is reproducible with our sample on your end. If the issue does not occur with our sample, we kindly ask that you modify our sample to reproduce the problem and share the updated sample with us. Alternatively, you can share your sample in which the issue occurs. This will help us to assist you further in identifying the cause.


Regards,

Vidyalakshmi M.



Attachment: SampleAndVideo_1bc45020.zip


MK Martin Kammann replied to Iain Stirzaker April 15, 2025 06:10 AM UTC

Hi Iain, I was sidetracked for a couple of days and am getting back to this today. Thus far I have no luck whatsoever. For my sanity of it I added a standard Maui Image control to the same page as the image editor. The image control worked just fine, as expected, but to date I have not been able to bring up something in the SfImageEditor control on Android. iOS is just fine. 

Things that I have tried:

  • Use MainThread.BeginInvokeOnMainThread() to get around potential thread issues

  • Copied the entire image using a byte[].ToArray() 

  •  In the past with Xamarin I had cases where some controls did not work in modal pages. In this case it was also on a modal page, so I changed it to a non-modal version. That did not help either.
I am running out of ideas. Iain, did you get anywhere?


MK Martin Kammann April 16, 2025 12:43 AM UTC

I come bearing good news! I have worked out what the Android issue was, at least in my case, and more importantly, how to replicate and fix it.

Here's how to replicate the issue in the example provided by Vidyalakshmi: Replace MainPage.Xaml with the code below. Run the app and voila: The image editor refuses to show any images. The fact that I wrapped the Grid into a ScrollView is all that's needed to replicate the behaviour. Remove the scrollview and it works again.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:imageEditor="clr-namespace:Syncfusion.Maui.ImageEditor;assembly=Syncfusion.Maui.ImageEditor"
             x:Class="MauiImageEditor.MainPage">
    <ScrollView>
        <Grid RowDefinitions="0.8*, 0.1*, 0.1*">
            <imageEditor:SfImageEditor x:Name="imageEditor"
                                   Source="https://picsum.photos/200/300" />
            <Button x:Name="loadFromResource"
                Grid.Row="1"
                Text="Load Image from Resource Folder"
                Clicked="loadFromResource_Clicked" />
            <Button x:Name="loadFromURI"
                Grid.Row="2"
                Text="Load Image from URI"
                Clicked="loadFromURI_Clicked" />
        </Grid>
    </ScrollView>
</ContentPage>


IS Iain Stirzaker replied to Martin Kammann April 16, 2025 04:11 AM UTC

Awesome news Martin!

That's the situation for me, too - the scrollview wrapping a grid causes the issue.


@Syncfusion - please can you have this fixed soonest as this issue affects our app's Android live date.

Iain



TG Tamilarasan Gunasekaran Syncfusion Team April 22, 2025 03:33 PM UTC

Hi Iain,

# Regarding Image fails to load when ImageEditor is placed Inside a ScrollView.

We have checked, and we can replicate the reported issue from our end. We have logged an issue report for the same; we will fix this issue and include the issue fix in our weekly NuGet release update which is expected to be available by May 06, 2025. We appreciate your patience until then.

You can track the status of this report through the following feedback link: https://www.syncfusion.com/feedback/67130/image-fails-to-load-when-imageeditor-is-placed-inside-a-scrollview

Note: The provided feedback link is private, and you need to log in to view this feedback.

Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.

Regards,

Tamilarasan G.



VO Vishal Omprasad Syncfusion Team May 9, 2025 04:02 PM UTC

Hi Iain,

We have fixed the reported scenario “Image fails to load when ImageEditor is placed Inside a ScrollView” from our end. To ensure proper rendering of images in the SfImageEditor when used within a ScrollView, it is recommended to set the MinimumHeightRequest property. Due to the testing phase, we have prepared a custom patch (NuGet) that includes the fix and have attached it below for your reference. Please test the patch and let us know if your issue is resolved.

Important Note: Since the SfImageEditor control includes built-in scrolling functionality, it is not recommended to place it inside other scrollable controls such as ScrollView. Nesting within such controls results in unexpected issues. We will be updating our User Guide with this information at the earliest.

Note:
Before installing the patch, please follow the below steps to remove the old cache NuGet and check your application with the provided NuGet:

  1. Uninstall the Syncfusion NuGet installed in your application.

  2. Clear your application NuGet cache referring the KB: How to clear NuGet cache?.

  3. Clean your application.

  4. When installing patch, install the dependency NuGets first (Syncfusion.Maui.Core, Syncfusion.Maui.Sliders) and then install the patch NuGet for the SfImageEditor control (Syncfusion.Maui.ImageEditor).

  5. Check the reported problem.

Disclaimer:

Please note that the patch was prepared specifically for version 29.1.41. We will include the issue fix in our upcoming weekly NuGet release update. We will let you know once the NuGet release is rolled-out and appreciate your patience until then.

Regards,
Vishal O.


Attachment: ImageEditorInScrollView_4f6f2d9e.zip


VO Vishal Omprasad Syncfusion Team May 21, 2025 08:16 AM UTC

Hi Iain,

We have fixed the reported scenario “Image fails to load when ImageEditor is placed Inside a ScrollView” from our end and included the fix in the latest weekly NuGet release update version 29.2.5, which is available for download in nuget.org.

Root-cause: SfImageEditor inside a ScrollView receives infinite size and falls back to minimum size. The calculated available height becomes negative due to toolbar space, preventing the image from rendering.

We thank you for your support and appreciate your patience in waiting for this update. Please feel free to reach out to us if you would require any further assistance.

Regards,
Vishal O.


Marked as answer
Loader.
Up arrow icon