Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Logcat warns that FCM has no default notification channel in AndroidManifest

ErrorW/FirebaseMessaging: Missing Default Notification Channel metadata in AndroidManifest. Default value will be used

Short answer

This is a warning, not a crash. FCM found no default_notification_channel_id in AndroidManifest.xml, so it puts notifications that name no channel into its own built-in default channel. To use your own channel, add the meta-data entry and also create a channel with the same ID in code before a message arrives.

  • Applies to Android 8.0+ (API 26+), Firebase Cloud Messaging Android SDK, Kotlin
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check whether the manifest already carries the channel entry, and which channel your messages name, if any.

    grep -n "default_notification_channel_id" app/src/main/AndroidManifest.xml
  2. 2Match what you see, then jump to its fix

    1. 1The log line appears at start-up and notifications still arrive in the system channelNo default channel is declared, and the warning is only informationalFix
    2. 2The entry is present, yet notifications still land in the built-in channelThe manifest names a channel that the app never createdFix
    3. 3The app targets API 26 or higher and a notification built in onMessageReceived never showsYour own notification is posted without any channelFix

What does the error look like?

  • W/FirebaseMessaging: Missing Default Notification Channel metadata in AndroidManifest. Default value will be used
  • Notification does not appear on Android 8 and later

Cause 1 of 3

No default channel is declared, and the warning is only informational

1Check

FCM supplies a default channel with basic settings. If your messages do not name a channel and you never declared your own default, FCM falls back to that built-in one. Nothing is broken.

adb logcat -s FirebaseMessaging

2Fix

If the built-in channel is fine, leave it. If you want your own name, importance and sound, declare your channel as the default inside the application element.

<application ...>
    <meta-data
        android:name="com.google.firebase.messaging.default_notification_channel_id"
        android:value="@string/default_notification_channel_id" />
</application>

<!-- res/values/strings.xml -->
<string name="default_notification_channel_id" translatable="false">general_updates</string>

3Verify

Rebuild, reinstall and start the app. The warning is gone from the log.

adb logcat -s FirebaseMessaging

Confirmed by firebase.google.com

Did this fix it?

Cause 2 of 3

The manifest names a channel that the app never created

1Check

The manifest value is only an ID. A channel with that exact ID has to exist on the device, so look for the code that registers it.

grep -rn "createNotificationChannel" app/src/main/

2Fix

Create the channel at app start, before any message can arrive, using the same ID as the manifest. Creating it again with its original values does nothing, so running it on every start is safe.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    val channel = NotificationChannel(
        getString(R.string.default_notification_channel_id),
        "General updates",
        NotificationManager.IMPORTANCE_DEFAULT
    )
    getSystemService(NotificationManager::class.java)
        .createNotificationChannel(channel)
}

3Verify

Send a test notification. In system settings the app now lists your channel by its name.

adb logcat -s FirebaseMessaging

Confirmed by github.com

Did this fix it?

Cause 3 of 3

Your own notification is posted without any channel

1Check

When FCM shows the notification itself it uses a channel. When your code builds one, for example from a data message, every notification must be assigned to a channel on Android 8.0 and later, or it does not appear and the system logs an error.

grep -rn "NotificationCompat.Builder" app/src/main/

2Fix

Pass the channel ID to the builder, and make sure that channel was created first as in the previous cause.

val notification = NotificationCompat.Builder(
    this, getString(R.string.default_notification_channel_id)
)
    .setSmallIcon(R.drawable.ic_stat_notification)
    .setContentTitle(title)
    .setContentText(body)
    .build()

3Verify

Send a data message with the app in the foreground and confirm the notification is posted.

adb logcat -s FirebaseMessaging

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Keep the channel ID in one string resource and use it in the manifest, in channel creation and in every builder.
  • Create channels in Application.onCreate so they exist before the first push.
  • Remember that a channel's importance cannot be changed by the app after creation; choose a new ID if you need different behaviour.
  • Turn on Show notification channel warnings under Developer options on a test device.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.