firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.67k stars 3.97k forks source link

🐛 [firebase_messaging dev] onBackgroundMessage could not find and invoke the GeneratedPluginRegistrant #4543

Closed rehamalraee closed 3 years ago

rehamalraee commented 3 years ago

Bug report

Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@7d7493b) but could not find and invoke the GeneratedPluginRegistran I have FCM configuration in my app, and its working fine until I invoke my background handler in the app background running state, I got that

Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@7d7493b) but could not find and invoke the GeneratedPluginRegistrant.

but when I tried to register manually using flutterEngine?.getPlugins()?.add(FirebaseMessagingPlugin())

I got that the FCM already registered with this engine, ## then the notifications never been received

this is how I call my Background handler:

    ```
           if (flutterEngine == null) {
        handler?.let { callbackRawHandle ->
            flutterEngine = FlutterEngine(contextm).also { engine ->
                val callbackInformation =
                    FlutterCallbackInformation.lookupCallbackInformation(callbackRawHandle)
                engine.dartExecutor.executeDartCallback(
                    DartExecutor.DartCallback(
                        contextm!!.getAssets(),
                        FlutterMain.findAppBundlePath(),
                        callbackInformation
                    )
                )
            }
        }

    }

### Steps to reproduce

Steps to reproduce the behavior:
1.close your app from the recent app 
2.Send a notification -- received correctly 
3. call ur app background function 
4. Send a new notification -- (not received ) and onBackgroundMessageHandler not invoked 

### Expected behavior

I expect that FCM will work with any other background handler
---
markusaksli-nc commented 3 years ago

Hi @rehamalraee Could you please provide your flutter doctor -v, and flutter pub deps -- --style=compact? Thank you

rehamalraee commented 3 years ago

@markusaksli-nc hello

deps

Dart SDK 2.10.4
Flutter SDK 1.22.5
vrbt 1.0.0+1

dependencies:
- android_alarm_manager 0.4.5+17 [flutter]
- cached_network_image 2.5.0 [flutter flutter_cache_manager octo_image]
- call_log 2.1.0 [flutter]
- carousel_slider 2.3.1 [flutter]
- contacts_service 0.4.6 [flutter collection quiver]
- convex_bottom_bar 2.6.0 [flutter]
- country_code_picker 1.7.0 [flutter modal_bottom_sheet]
- cupertino_icons 1.0.0
- delayed_display 1.1.0 [flutter]
- dio 3.0.10 [http_parser path]
- firebase_core 0.5.3 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_messaging 7.0.3 [meta flutter firebase_core]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_downloader 1.5.2 [flutter]
- flutter_phoenix 0.1.0 [flutter]
- flutter_phone_direct_caller 1.0.1 [flutter]
- flutter_spinkit 4.1.2+1 [flutter]
- fluttercontactpicker 4.2.1 [flutter contact_picker_platform_interface contact_picker_web]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- image_picker 0.6.7+17 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- intl 0.16.1 [path]
- intl_phone_number_input 0.6.0 [flutter meta libphonenumber libphonenumber_plugin equatable]
- libphonenumber 1.0.2 [flutter meta]
- loader_overlay 1.1.1 [flutter]
- numeric_keyboard 1.0.0 [flutter]
- path_provider 1.6.24 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- permission_handler 5.0.1+1 [flutter meta permission_handler_platform_interface]
- screen 0.0.5 [flutter]
- shared_preferences 0.5.12+4 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_p
references_windows]
- sim_info 0.1.3 [flutter]
- splashscreen 1.3.5 [flutter]
- thumbnails 1.0.1 [flutter]
- unicorndial 1.1.5 [flutter]
- url_launcher 5.7.10 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos url_launcher_windows]
- video_player 1.0.1 [meta video_player_platform_interface video_player_web flutter]
- video_thumbnail 0.2.5+1 [flutter]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span
 stream_channel string_scanner term_glyph typed_data]

transitive dependencies:
- archive 2.0.13 [crypto args path]
- args 1.6.0
- async 2.5.0-nullsafety.1 [collection]
- boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner]
- characters 1.1.0-nullsafety.3
- charcode 1.2.0-nullsafety.1
- clock 1.1.0-nullsafety.1
- collection 1.15.0-nullsafety.3
- contact_picker_platform_interface 4.2.0 [flutter meta plugin_platform_interface]
- contact_picker_web 4.2.1 [flutter flutter_web_plugins js contact_picker_platform_interface]
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- equatable 1.2.5 [collection meta]
- fake_async 1.2.0-nullsafety.1 [clock collection]
- ffi 0.1.3
- file 5.2.1 [intl meta path]
- firebase_core_platform_interface 2.1.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.1+1 [firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_blurhash 0.5.0 [flutter meta]
- flutter_cache_manager 2.1.0 [flutter path_provider uuid http path sqflite pedantic clock file rxdart image]
- flutter_plugin_android_lifecycle 1.0.11 [flutter]
- flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
- image 2.1.19 [archive xml meta]
- image_picker_platform_interface 1.1.1 [flutter meta http plugin_platform_interface]
- js 0.6.2
- libphonenumber_platform_interface 0.2.0 [flutter plugin_platform_interface]
- libphonenumber_plugin 0.1.0 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web]
- libphonenumber_web 0.1.1 [flutter flutter_web_plugins js libphonenumber_platform_interface]
- matcher 0.12.10-nullsafety.1 [stack_trace]
- meta 1.3.0-nullsafety.3
- modal_bottom_sheet 1.0.1-dev [flutter]
- octo_image 0.3.0 [flutter flutter_blurhash]
- path 1.8.0-nullsafety.1
- path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 0.0.4+6 [flutter]
- path_provider_platform_interface 1.0.4 [flutter meta platform plugin_platform_interface]
- path_provider_windows 0.0.4+3 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.9.2 [meta]
- permission_handler_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- petitparser 3.1.0 [meta]
- platform 2.2.1
- plugin_platform_interface 1.0.3 [meta]
- process 3.0.13 [file intl meta path platform]
- quiver 2.1.5 [matcher meta]
- rxdart 0.24.1
- shared_preferences_linux 0.0.2+4 [file flutter meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 0.0.1+11 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 1.0.4 [meta flutter]
- shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 0.0.1+3 [shared_preferences_platform_interface flutter ffi file meta path path_provider_platform_interface path_provider_windows]
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph]
- sqflite 1.3.2+1 [flutter sqflite_common path]
- sqflite_common 1.0.2+1 [synchronized path meta]
- stack_trace 1.10.0-nullsafety.1 [path]
- stream_channel 2.1.0-nullsafety.1 [async]
- string_scanner 1.1.0-nullsafety.1 [charcode source_span]
- synchronized 2.2.0+2
- term_glyph 1.2.0-nullsafety.1
- test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0-nullsafety.3 [collection]
- url_launcher_linux 0.0.1+4 [flutter]
- url_launcher_macos 0.0.1+9 [flutter]
- url_launcher_platform_interface 1.0.9 [flutter meta plugin_platform_interface]
- url_launcher_web 0.1.5+1 [url_launcher_platform_interface flutter flutter_web_plugins meta]
- url_launcher_windows 0.0.1+3 [flutter]
- uuid 2.2.2 [crypto convert]
- vector_math 2.1.0-nullsafety.3
- video_player_platform_interface 2.2.0 [flutter meta]
- video_player_web 0.1.4+1 [flutter flutter_web_plugins meta video_player_platform_interface]
- win32 1.7.3 [ffi]
- xdg_directories 0.1.2 [meta path process]
- xml 4.5.1 [collection convert meta petitparser]

doctor

[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19041.685], locale en-US)
    • Flutter version 1.22.5 at C:\Users\ThinkPad\Downloads\flutter
    • Framework revision 7891006299 (4 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\ThinkPad\AppData\Local\Android\Sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = C:\Users\ThinkPad\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[!] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (2 available)
    • CPH1821 (mobile)                   • O7VCSCWSIRJZEED6 • android-arm64 • Android 10 (API 29)
    • Android SDK built for x86 (mobile) • emulator-5554    • android-x86   • Android 8.1.0 (API 27) (emulator)

! Doctor found issues in 1 category.
markusaksli-nc commented 3 years ago

Could you try migrating to the new firebase_messaging: ^8.0.0-dev.11 version?

The update got rid of the old background messaging handler workaround and is more stable in general.

rehamalraee commented 3 years ago

@markusaksli-nc Hello, Is this update affects the background handler behavior? the usage of firebase_messaging: ^8.0.0-dev.11 is different from firebase_messaging: ^7.0.3.

markusaksli-nc commented 3 years ago

Yes the update affects the background handler, and the entire plugin in general. The version you are using will be replaced soon and even if the problem is with 7.0.3 the development effort is focused on the rework.

There is an official example for the new version and a list of breaking changes. You can also take a look at the migration page https://firebase.flutter.dev/docs/migration#messaging.

rehamalraee commented 3 years ago

@markusaksli-nc Hello, Are you know why the FCM is not received when my app foreground service is killed, to be more clear I'm trying to keep my app always running in the background and I used the foreground services to achieve this, sometimes the app not killed by the ANDROID system and the foreground notification appears for more than 15 hours, But other times it killed after 1 hour or less or 2hours and less when my foreground notification is killed and I send FCM notification it didn't receive by my device!! what is the problem here! how can I solve it!

markusaksli-nc commented 3 years ago

Like I said, could you try updating to the new version as it is a lot more stable in general.

There is an official example of how to use it at https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging/firebase_messaging/example/lib

Without a specific minimal complete reproducible code sample it is very hard to tell what could be wrong and as I said, the version you are using will be completely replaced and deprecated soon.

davidcz95 commented 3 years ago

Hi @markusaksli-nc ! Unfortunatelly I have all the recent versions of firebase_messaging an core and flutter and everything but I am still getiing an error:

Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@7d7493b) but could not find and invoke the GeneratedPluginRegistrant.

And it only happens when I add onBackgroundMessage method, without it notifications and everything is working great. But I need to save some data from notification to sharedpreferences but this is just not working, I have spend the whole day today researching and trying different solutions on the internet but nothing works...

Also I am getting those while building I don't know if it should be this way or is it related to the problem:

Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.7.0\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-8.0.0-dev.14\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java uses or overrides a deprecated API.
flutter doctor -v ```console [√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19041.685], locale pl-PL) • Flutter version 1.22.5 at C:\src\flutter • Framework revision 7891006299 (5 weeks ago), 2020-12-10 11:54:40 -0800 • Engine revision ae90085a84 • Dart version 2.10.4 [√] Android toolchain - develop for Android devices (Android SDK version 30.0.1) • Android SDK at C:\Users\Dawid Czuchnowski\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.1 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [!] Android Studio (version 4.1.0) • Android Studio at C:\Program Files\Android\Android Studio X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [!] VS Code (version 1.51.1) • VS Code at C:\Users\Dawid Czuchnowski\AppData\Local\Programs\Microsoft VS Code X Flutter extension not installed; install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [√] Connected device (2 available) • VOG L29 (mobile) • DUM0219B28008485 • android-arm64 • Android 10 (API 29) • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) ! Doctor found issues in 2 categories. ```
`flutter pub deps -- --style=compact` ```console Dart SDK 2.10.4 Flutter SDK 1.22.5 mobilgo 1.0.0+2 dependencies: - android_intent 0.3.7+7 [flutter platform meta] - auto_route 0.4.6 [flutter] - built_value 7.1.0 [built_collection collection fixnum quiver] - cupertino_icons 0.1.3 - dropdown_formfield 0.1.3 [flutter] - equatable 1.2.5 [collection meta] - firebase_core 0.7.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web] - firebase_messaging 8.0.0-dev.14 [meta flutter firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_bloc 6.0.6 [flutter bloc provider] - flutter_form_bloc 0.19.0 [flutter bloc flutter_bloc form_bloc rxdart flutter_keyboard_visibility collection intl] - flutter_google_places 0.2.6 [flutter rxdart google_maps_webservice http] - flutter_keyboard_visibility 3.2.2 [flutter] - flutter_local_notifications 3.0.3 [flutter platform flutter_local_notifications_platform_interface timezone] - flutter_localizations 0.0.0 [flutter intl characters collection meta path typed_data vector_math] - flutter_svg 0.18.1 [path_drawing xml vector_math meta flutter] - flutter_webview_plugin 0.3.11 [flutter] - fluttertoast 7.1.1 [flutter flutter_web_plugins] - geocoding 1.0.5 [flutter geocoding_platform_interface url_launcher] - geolocator 6.1.4+1 [flutter geolocator_platform_interface] - google_fonts 1.1.1 [flutter http path_provider crypto pedantic] - google_map_location_picker 4.0.0 [flutter flutter_localizations intl intl_translation google_maps_flutter geolocator android_intent provider http stack_trace package_info] - google_maps_flutter 1.0.6 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface] - google_maps_webservice 0.0.18 [http meta] - google_places_flutter 2.0.3 [flutter dio rxdart] - grouped_buttons 1.0.4 [flutter] - http 0.12.2 [http_parser path pedantic] - intl 0.16.1 [path] - json_annotation 3.1.0 - kiwi 0.2.0 - loading_overlay 0.2.1 [flutter] - location 3.1.0 [flutter meta location_platform_interface location_web] - location_permissions 3.0.0+1 [flutter meta] - shared_preferences 0.5.12+4 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - uuid 2.2.2 [crypto convert] - webview_flutter 1.0.5 [flutter] dev dependencies: - auto_route_generator 0.4.10 [build source_gen analyzer auto_route] - build_runner 1.10.2 [args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style glob graphs http_multi_server io js logging meta mime path pedantic pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - built_value_generator 7.1.0 [analyzer build build_config built_collection built_value source_gen quiver] - flutter_launcher_icons 0.8.1 [image args yaml path] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] - json_serializable 3.5.0 [analyzer build build_config json_annotation meta path source_gen] transitive dependencies: - _fe_analyzer_shared 7.0.0 [meta] - analyzer 0.39.17 [_fe_analyzer_shared args charcode cli_util collection convert crypto glob html meta package_config path pub_semver source_span watcher yaml] - archive 2.0.13 [crypto args path] - args 1.6.0 - async 2.5.0-nullsafety.1 [collection] - bloc 6.1.0 [meta] - bloc_test 7.0.6 [bloc test meta mockito] - boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner] - build 1.3.0 [analyzer async convert crypto logging meta path glob] - build_config 0.4.2 [checked_yaml json_annotation meta path pubspec_parse yaml] - build_daemon 2.1.4 [built_collection built_value http_multi_server logging pedantic path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 1.3.11 [analyzer build crypto graphs logging path package_config pub_semver] - build_runner_core 6.0.1 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pedantic pool timing watcher yaml] - built_collection 4.3.2 [collection quiver] - characters 1.1.0-nullsafety.3 - charcode 1.2.0-nullsafety.1 - checked_yaml 1.0.2 [json_annotation source_span yaml] - cli_util 0.2.0 [path] - clock 1.1.0-nullsafety.1 - code_builder 3.5.0 [built_collection built_value collection matcher meta] - collection 1.15.0-nullsafety.3 - convert 2.1.1 [charcode typed_data] - coverage 0.14.1 [args logging package_config path source_maps stack_trace vm_service] - crypto 2.1.5 [collection convert typed_data] - csslib 0.16.2 [source_span] - dart_style 1.3.6 [analyzer args path source_span] - dio 3.0.10 [http_parser path] - fake_async 1.2.0-nullsafety.1 [clock collection] - ffi 0.1.3 - file 5.2.1 [intl meta path] - firebase_core_platform_interface 3.0.1 [flutter meta plugin_platform_interface quiver] - firebase_core_web 0.2.1+3 [firebase_core_platform_interface flutter flutter_web_plugins meta js] - firebase_messaging_platform_interface 1.0.0-dev.10 [flutter meta firebase_core plugin_platform_interface] - firebase_messaging_web 0.1.0-dev.5 [flutter flutter_web_plugins meta firebase_core firebase_core_web firebase_messaging_platform_interface js service_worker] - fixnum 0.10.11 - flutter_local_notifications_platform_interface 2.0.0+1 [flutter plugin_platform_interface] - flutter_plugin_android_lifecycle 1.0.11 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math] - form_bloc 0.19.1 [meta bloc bloc_test rxdart equatable quiver mockito pedantic collection uuid] - geocoding_platform_interface 1.0.1+1 [flutter meta plugin_platform_interface] - geolocator_platform_interface 1.0.8 [flutter meta plugin_platform_interface vector_math] - glob 1.2.0 [async collection node_io path pedantic string_scanner] - google_maps_flutter_platform_interface 1.0.4 [flutter meta plugin_platform_interface stream_transform] - graphs 0.2.0 - html 0.14.0+4 [csslib source_span] - http_multi_server 2.2.0 [async] - http_parser 3.1.4 [charcode collection source_span string_scanner typed_data] - image 2.1.19 [archive xml meta] - intl_translation 0.17.10 [analyzer args dart_style intl path petitparser] - io 0.3.4 [charcode meta path string_scanner] - js 0.6.3-nullsafety.2 - location_platform_interface 1.0.1 [flutter meta plugin_platform_interface] - location_web 1.0.0 [flutter flutter_web_plugins location_platform_interface http_parser meta js] - logging 0.11.4 - matcher 0.12.10-nullsafety.1 [stack_trace] - meta 1.3.0-nullsafety.3 - mime 0.9.7 - mockito 4.1.3 [analyzer build code_builder collection dart_style matcher meta source_gen test_api] - nested 0.0.4 [flutter] - node_interop 1.1.1 [js] - node_io 1.1.1 [node_interop path] - node_preamble 1.4.12 - package_config 1.9.3 [path charcode] - package_info 0.4.3 [flutter] - path 1.8.0-nullsafety.1 - path_drawing 0.4.1+1 [vector_math meta path_parsing flutter] - path_parsing 0.1.4 [vector_math meta] - path_provider 1.6.22 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter] - path_provider_macos 0.0.4+4 [flutter] - path_provider_platform_interface 1.0.3 [flutter meta platform plugin_platform_interface] - path_provider_windows 0.0.4+1 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.10.0-nullsafety.2 - petitparser 3.1.0 [meta] - platform 2.2.1 - plugin_platform_interface 1.0.3 [meta] - pool 1.5.0-nullsafety.2 [async stack_trace] - process 3.0.13 [file intl meta path platform] - provider 4.3.2+2 [flutter nested collection] - pub_semver 1.4.4 [collection] - pubspec_parse 0.1.5 [checked_yaml json_annotation pub_semver yaml] - quiver 2.1.3 [matcher meta] - rxdart 0.24.1 - service_worker 0.2.4 [js] - shared_preferences_linux 0.0.2+4 [file flutter meta path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 0.0.1+11 [shared_preferences_platform_interface flutter] - shared_preferences_platform_interface 1.0.4 [meta flutter] - shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta] - shared_preferences_windows 0.0.1+3 [shared_preferences_platform_interface flutter ffi file meta path path_provider_platform_interface path_provider_windows] - shelf 0.7.9 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 2.0.0 [path shelf shelf_static] - shelf_static 0.2.8 [convert http_parser mime path shelf] - shelf_web_socket 0.2.3 [shelf web_socket_channel stream_channel] - sky_engine 0.0.99 - source_gen 0.9.7+1 [analyzer async build dart_style glob meta path pedantic source_span] - source_map_stack_trace 2.1.0-nullsafety.3 [path stack_trace source_maps] - source_maps 0.10.10-nullsafety.2 [source_span] - source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph] - stack_trace 1.10.0-nullsafety.1 [path] - stream_channel 2.1.0-nullsafety.1 [async] - stream_transform 1.2.0 - string_scanner 1.1.0-nullsafety.1 [charcode source_span] - term_glyph 1.2.0-nullsafety.1 - test 1.16.0-nullsafety.5 [analyzer async boolean_selector coverage http http_multi_server io js node_preamble package_config path pedantic pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core] - test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - test_core 0.3.12-nullsafety.5 [analyzer async args boolean_selector collection coverage glob io meta package_config path pedantic pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api] - timezone 0.5.9 [path] - timing 0.1.1+2 [json_annotation] - typed_data 1.3.0-nullsafety.3 [collection] - url_launcher 5.7.10 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos url_launcher_windows] - url_launcher_linux 0.0.1+4 [flutter] - url_launcher_macos 0.0.1+9 [flutter] - url_launcher_platform_interface 1.0.9 [flutter meta plugin_platform_interface] - url_launcher_web 0.1.5+1 [url_launcher_platform_interface flutter flutter_web_plugins meta] - url_launcher_windows 0.0.1+3 [flutter] - vector_math 2.1.0-nullsafety.3 - vm_service 5.2.0 [meta] - watcher 0.9.7+15 [async path pedantic] - web_socket_channel 1.1.0 [async crypto stream_channel] - webkit_inspection_protocol 0.7.3 [logging] - win32 1.7.3 [ffi] - xdg_directories 0.1.2 [meta path process] - xml 4.5.1 [collection convert meta petitparser] - yaml 2.2.1 [charcode collection string_scanner source_span]` ```
rehamalraee commented 3 years ago

hello @davidcz95 u have to use this FirebaseMessagingPlugin.registerWith(registry!!.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")) in ur registerWith function

davidcz95 commented 3 years ago

@rehamalraee Thank you for your answer but I have automatically generated "GeneratedPluginRegistrant" as it should be according to the newest documentation my MainActivity is mostly empty So I dont think I can solve it this Way... Or should I manulaly add this line to the mainactivity?

rehamalraee commented 3 years ago

@davidcz95 yes try this.

davidcz95 commented 3 years ago

@rehamalraee Well I can't quite figure this out this is all I have in my MainActivity could you provide me with some tips of how to incorporate your solution?

public class MainActivity extends FlutterActivity {}

rehamalraee commented 3 years ago

@davidcz95 check for these

<meta-data
    android:name="flutterEmbedding"
    android:value="2" />

in your android manifest, And I'll provide u with the code.

rehamalraee commented 3 years ago

@davidcz95 check this solution,

davidcz95 commented 3 years ago

@rehamalraee yes I have it in my AndroidManifest as I said I have all the udpated and newest versions of the plugins and I followed every point in the migration guide

davidcz95 commented 3 years ago

@rehamalraee ok so I used this solution created new kt file and paste there the code also I have change in the manifest android:name to point into it but I am getting this errors now:

e: D:\AndroidStudioProjects\mobilgo\android\app\src\main\java\io\flutter\plugins\Application.kt: (5, 27): Unresolved reference: firebasemessaging
e: D:\AndroidStudioProjects\mobilgo\android\app\src\main\java\io\flutter\plugins\Application.kt: (12, 9): Unresolved reference: FlutterFirebaseMessagingService
e: D:\AndroidStudioProjects\mobilgo\android\app\src\main\java\io\flutter\plugins\Application.kt: (16, 9): Unresolved reference: FirebaseCloudMessagingPluginRegistrant

And I think this is because the newest docs says that we don't need to change native code to register those plugins any more but it just don't work so I think devs just needs to fix it as the new version is just not working at all and I think I will have to downgrade to 7.0.5 from the newest 8.0.0-dev.14 until someone fix it...

itssidhere commented 3 years ago

@davidcz95 Have you tried running flutter clean after upgrading to lates 8.0.0-dev.14 and following the migration guide. It fixed every issues for me.

davidcz95 commented 3 years ago

Yes I did I even did pub cache repair twice and after that I have even created a New project and copy all the files there and still got the same error. Everything is working great until i try to invoke onBackground method...

markusaksli-nc commented 3 years ago

@davidcz95 Do you still have the Application.java hack for background message handling with the old version? If so you need to remove it.

@rehamalraee What is the status here? Have you been able to solve the issue for yourself?

davidcz95 commented 3 years ago

@markusaksli-nc Hey, No, as I said I have empty MainActivity and followed all tips in migration guide also I have all the newest plugins, but the problem still persist..

I really can't solve it. Do you need any more information? This is my AndroidManifest:

`<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="EXAMPLE">

<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:label=EXAMPLE"
    android:icon="@mipmap/launcher_icon">
    <activity
        android:name="io.flutter.plugins.MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">

        <!-- Displays an Android View that continues showing the launch screen
             Drawable until Flutter paints its first frame, then this splash
             screen fades out. A splash screen is useful to avoid any visual
             gap between the end of Android's launch screen and the painting of
             Flutter's first frame. -->
        <meta-data
          android:name="io.flutter.embedding.android.SplashScreenDrawable"
          android:resource="@drawable/launch_background"
          />

        <!-- Specifies an Android theme to apply to this Activity as soon as
             the Android process has started. This theme is visible to the user
             while the Flutter UI initializes. After that, this theme continues
             to determine the Window background behind the Flutter UI. -->
        <meta-data
            android:name="io.flutter.embedding.android.NormalTheme"
            android:resource="@style/NormalTheme"
            />
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

    </activity>
    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />

    <meta-data android:name="com.google.android.geo.API_KEY"
        android:value="EXAMPLE"/>

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

</application>

`

rehamalraee commented 3 years ago

@markusaksli-nc hi, Not yet, Still I'm waiting for the response for this firebase core issue if this will solve it also or not.

davidcz95 commented 3 years ago

@markusaksli-nc I see you changed it to deprecated-version, but I have the newest, should I create a new issue?

markusaksli-nc commented 3 years ago

Since it is the same error log I don't think that will be necessary.

Also I removed the deprecated version label because this seems to be for the latest version for both of you.

rehamalraee commented 3 years ago

Update: The WARNING still appears after updating to the new version, BUT it didn't affect the functionality or stop the app as before, so I'm going to close this and wait for the new release documentation if this will be solved or not.

markusaksli-nc commented 3 years ago

Closing this for now since it is just a warning and it seems like a rare one at that.

rehamalraee commented 3 years ago

@markusaksli-nc Hello, Is there a way to know when the DART executor finish? I search a lot but there is no helpful resource, please if u can help I'll appreciate ur kindness. I want to know when the flutter background code finish the work to destroy the flutter engine since I'll call the function on each phone call

markusaksli-nc commented 3 years ago

I'm not sure, you could always ask in the community https://stackoverflow.com/tags/flutter https://www.reddit.com/r/FlutterDev/.