FIREBASE-MESSAGING : App stops responding when it receives a notification on Android #17350
Open
1 task done
Labels
blocked: customer-response
Waiting for customer response, e.g. more information was requested.
platform: android
Issues / PRs which are specifically for Android.
plugin: messaging
type: bug
Something isn't working
Is there an existing issue for this?
Which plugins are affected?
Messaging
Which platforms are affected?
Android
Description
My Flutter app crashes on Android when receiving Firebase push notifications — both in foreground and background.
Everything works fine on iOS. I’ve tried deleting the android folder and setting up again, but it still crashes consistently.
crash behaviour:
it shows a popup that says " isn't responding", with options to wait or close app.
debug console after crash
current setup
-Flutter Version: 3.27.4 (channel stable)
-Android Gradle Plugin: 8.2.0
-Kotlin Version: 1.9.0
-google-services Plugin: 4.4.2
-Firebase Messaging Version: 15.2.5
-Test Devices: Multiple Android phones (physical device and emulators)
relevant code
Android build.gradle (app-level):
manifest
I use Flutter's FirebaseMessaging.onMessage, onMessageOpenedApp, getInitialMessage, and a top-level firebaseMessagingBackgroundHandler I also register the background handler in main() before anything else
Things i've tried
-Verified google-services.json is present in the android/app directory
-Confirmed the package name in google-services.json matches my app's package name
-Updated all Firebase dependencies to the latest versions
-Verified the manifest has the proper FCM service declarations
-Tried both with and without the Firebase BOM
-Rebuilt and cleaned the project multiple times
-Verified Flutter Firebase plugins are correctly initialized in the Dart code
-Tried downgrading Google Services plugin versions
-Verified manifest includes required Firebase messaging services and permissions
-Tested with and without custom deep link payload
-Ensured firebaseMessagingBackgroundHandler is @pragma('vm:entry-point')
-Validated local notification handling logic in foreground
-Removed unnecessary platform-specific logic (no effect)
-Tried using a minimal PushNotificationService setup (still crashes)
-ic_notification.png is correctly placed in res/drawable
-FirebaseMessagingService.java exists
-Using FlutterLocalNotificationsPlugin for foreground display
-also tried with calling await Firebase.initializeApp in the toplevel background handler
running
~/Library/Android/sdk/platform-tools/adb logcat | grep -E "(flutter|Firebase|Exception|Error)"
and
~/Library/Android/sdk/platform-tools/adb logcat | grep Firebase
Doesn’t seem to bring any specific crash reason
Reproducing the issue
I setup firebase message with the instructions on the firebase console, then i send a notification to android
Firebase Core version
3.13.0
Flutter Version
3.27.4
Relevant Log Output
Flutter dependencies
Additional context and comments
No response
The text was updated successfully, but these errors were encountered: