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) 1,185 Reputation points Microsoft External Staff
    2025-08-12T07:49:58.95+00:00

    Hi Sreejith Sreenivasan!

    Your icon issue in Android 15 likely stems from two factors:

    Incorrect Build Action: You have the build action set to 'None' - it should be 'AndroidResource' for drawable resources.

    Icon Compliance: While Android has required monochrome notification icons since version 5.0, Android 15 may enforce this more strictly. Your icon that worked in Android 14 might not be fully compliant (perhaps it has some gray/colored pixels instead of pure white), and Android 15's stricter validation is now rejecting it.

    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


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.