Closed discoveruz closed 1 year ago
Thanks for the report @discoveruz When you say, error occurs while exiting the program, do you mean, when the app has been terminated and then notification arrives which throws the said error ? What's the OS version of your Android device ? Can you also try the plugin example on same device and see if using it, you get same error as reported ?
From Firebase documentation. https://github.com/firebase/quickstart-android/blob/214da24d38a2af723f6953c4f1c18a7ad3d68d08/messaging/app/src/main/AndroidManifest.xml#L24-L26
Add that
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
you can substitute the value on android:value="@string/default_notification_channel_id" /> for
android:value="
Hey @discoveruz. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@discoveruz if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.
Hi, I think this is related to [Firebase_messaging] duplication bug and two threads launched by background handler #9912, as described also here: https://stackoverflow.com/questions/74430484/firebase-background-message-handler-in-flutter-spawns-duplicate-isolate-and-runs Anyway, you should create a notification channel to be used with FirebaseMessaging.onBackgroundMessage (when the app is terminated or suspended). It is when the main() is called twice... and that's why it will not find the default notification channel...
Bug report
An error occurs when a notification arrives on an Android device while exiting the program
Expected behavior
I ran the program and it works when a notification comes in the program, but after exiting the program, when it sends a back notification, the following error appears.
main
lib/services/notification_service.dart
android/app/src/main/AndroidManifest.xml
android/app/src/main/kotlin/com/example/my_app/MainActivity.kt
android/app/src/main/res/values/strings.xml
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
``` [β] Flutter (Channel stable, 3.3.7, on macOS 12.6 21G115 darwin-arm, locale en-UZ) β’ Flutter version 3.3.7 on channel stable at /Users/developer/flutter β’ Upstream repository https://github.com/flutter/flutter.git β’ Framework revision e99c9c7cd9 (4 weeks ago), 2022-11-01 16:59:00 -0700 β’ Engine revision 857bd6b74c β’ Dart version 2.18.4 β’ DevTools version 2.15.0 [β] Android toolchain - develop for Android devices (Android SDK version 33.0.0) β’ Android SDK at /Users/developer/Library/Android/sdk β’ Platform android-33, build-tools 33.0.0 β’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java β’ Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) β’ All Android licenses accepted. [β] Xcode - develop for iOS and macOS (Xcode 13.4.1) β’ Xcode at /Applications/Xcode.app/Contents/Developer β’ Build 13F100 β’ CocoaPods version 1.11.3 [β] Chrome - develop for the web β’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [β] Android Studio (version 2021.3) β’ Android Studio at /Applications/Android Studio.app/Contents β’ Flutter plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/9212-flutter β’ Dart plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/6351-dart β’ Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) [β] IntelliJ IDEA Ultimate Edition (version 2022.2.3) β’ IntelliJ at /Applications/IntelliJ IDEA.app β’ Flutter plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/9212-flutter β’ Dart plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/6351-dart [β] VS Code (version 1.73.1) β’ VS Code at /Applications/Visual Studio Code.app/Contents β’ Flutter extension version 3.52.0 [β] Connected device (3 available) β’ Redmi Note 8 Pro (mobile) β’ onrw45lrp7o7sg8t β’ android-arm64 β’ Android 11 (API 30) β’ macOS (desktop) β’ macos β’ darwin-arm64 β’ macOS 12.6 21G115 darwin-arm β’ Chrome (web) β’ chrome β’ web-javascript β’ Google Chrome 107.0.5304.121 [β] HTTP Host Availability β’ All required HTTP hosts are available β’ No issues found! ```Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below: