MAUI: Notification icon is blank in Android 15

Sreejith Sreenivasan 1,001 Reputation points
2025-04-28T14:53:02.68+00:00

I am using below code to show the push notification icon in my MAUI application:

private void CreateNotificationChannel()
{
    try
    {
        var channelId = $"{PackageName}.general";
        var notificationManager = (NotificationManager)GetSystemService(NotificationService);
        var channel = new NotificationChannel(channelId, "General", NotificationImportance.Default);
        notificationManager.CreateNotificationChannel(channel);
        FirebaseCloudMessagingImplementation.ChannelId = channelId;
        FirebaseCloudMessagingImplementation.SmallIconRef = global::ProjectNameSpace.Resource.Drawable.ic_notification;
    }
    catch (Exception exception)
    {
        Utility.SendCrashReport(exception);
    }
}

This icon is working fine upto android version 14, but in 15 the icon is breaking. Check the below screenshot. Inside the blue circle a grey square is showing, the real icon is not showing. I have added the icon in Platforms-Android-Resource-Drawable and build action set to None.

aaa

I also tried using the app icon from single project like below, but no luck.

using Resource = Microsoft.Maui.Resource;
FirebaseCloudMessagingImplementation.SmallIconRef = Resource.Mipmap.appicon;
Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tony Dinh (WICLOUD CORPORATION) 725 Reputation points Microsoft External Staff
    2025-08-12T07:49:58.95+00:00

    Hi Sreejith Sreenivasan!

    This issue might comes from the strict guideline of Android 15 "monochrome" color policy, When it encounters your icon file, it sees your color information (or other pixel data that doesn't conform to the all-white, transparent-background rule) and instead of trying to render it, it displays the default fallback, which is the gray square inside a circle.

    Here are solution steps you can try:

    1. Create and use a new icon file:

    Create a new PNG icon file and adheres the following rule:

    • The icon must be solid white color
    • The background must be completely transparent
    • Use an SVG or a high-resolution PNG file to ensure it looks good on all screen densities. The recommended size is 24x24 dp.

    You can use tool like Android Asset Studio to easilly generate a proper notification icon.

    1. Add the new icon to your project
    • Save this new, monochrome icon file.
    • Place it in your Platforms/Android/Resources/drawable folder.
    • Name it something like ic_notification_small.png.
    • Ensure its build action is set to AndroidResource.
    1. Update your code
    • Update your C# code to reference to this icon:
    private void CreateNotificationChannel()
    {
        try
        {
            var channelId = $"{PackageName}.general";
            var notificationManager = (NotificationManager)GetSystemService(NotificationService);
            var channel = new NotificationChannel(channelId, "General", NotificationImportance.Default);
            notificationManager.CreateNotificationChannel(channel);
            FirebaseCloudMessagingImplementation.ChannelId = channelId;
            // Update this line to point to your new monochrome icon.
            FirebaseCloudMessagingImplementation.SmallIconRef = global::ProjectNameSpace.Resource.Drawable.ic_notification_small;
        }
        catch (Exception exception)
        {
            Utility.SendCrashReport(exception);
        }
    }
    

    4. Rebuild the project

    • Clean and rebuild your project to ensure the new resources are properly integrated.

    These changes should provide Android 15 with a compatible icon that displays correctly in the notification area.

    Here are some useful source you can find:

    I hope this help! Let me know if you have any question

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.