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.73k stars 3.98k forks source link

🐛 [firebase_messaging] Android App Not Compiling BroadcastReceiver not found #8324

Closed jgarrett77 closed 2 years ago

jgarrett77 commented 2 years ago

Bug report

Describe the bug The Android application is unable to to compile due to cannot access BroadcastReceiver compile Error

Steps to reproduce

Steps to reproduce the behavior:

  1. Run app a Debug

Expected behavior

Application should compile and run

Debug

Workspace/exchange-mobile/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:49: error: cannot access BroadcastReceiver flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingPlugin()); ^ class file for android.content.BroadcastReceiver not found 1 error

FAILURE: Build failed with an exception.

Providing a minimal example project which demonstrates the bug in isolation from your main App greatly enhances the chance of a timely fix. Please link to the public repository URL.


Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.1, on macOS 12.2.1 21D62 darwin-x64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 13.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.65.2) [✓] VS Code (version 1.58.2) [✓] VS Code (version 1.58.2) [✓] Connected device (2 available) [✓] HTTP Host Availability ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 2.16.1 Flutter SDK 2.10.1 exchange 9.4.0 dependencies: - algolia 1.0.4 [meta http uuid] - animations 2.0.2 [flutter] - animator 3.1.0 [flutter states_rebuilder] - another_flushbar 1.10.28 [flutter] - cached_network_image 3.2.0 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - card_swiper 1.0.4 [flutter] - carousel_slider 4.0.0 [flutter] - chewie 1.3.0 [cupertino_icons flutter provider video_player wakelock very_good_analysis] - clippy_flutter 2.0.0-nullsafety.1 [flutter] - cloud_firestore 3.1.10 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - collection 1.15.0 - country_code_picker 2.0.2 [flutter modal_bottom_sheet collection universal_platform] - cupertino_icons 1.0.4 - dio 4.0.4 [http_parser path] - dots_indicator 2.1.0 [flutter] - dotted_line 3.1.0 [flutter] - expandable_bottom_sheet 1.1.1+1 [flutter] - file_picker 3.0.4 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface] - firebase_auth 3.3.10 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 1.13.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_messaging 10.0.9 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_storage 10.2.9 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - fl_chart 0.36.1 [flutter equatable pedantic] - flutter 0.0.0 [characters collection material_color_utilities meta typed_data vector_math sky_engine] - flutter_colorpicker 0.4.0 [flutter] - flutter_html 2.2.1 [html csslib flutter_layout_grid video_player chewie webview_flutter chewie_audio flutter_svg flutter_math_fork collection numerus flutter] - flutter_inappwebview 5.3.2 [flutter] - flutter_local_notifications 9.4.0 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path typed_data vector_math] - flutter_mobx 2.0.4 [flutter mobx] - flutter_native_timezone 2.0.0 [flutter_web_plugins flutter js] - flutter_paystack 1.0.5+1 [flutter http intl meta async] - flutter_pdfview 1.2.2 [flutter] - flutter_reaction_button 1.0.8 [flutter] - flutter_slidable 0.6.0 [flutter] - flutter_staggered_animations 1.0.0 [flutter] - flutter_staggered_grid_view 0.4.1 [flutter] - flutter_stripe 1.3.0 [flutter stripe_android stripe_ios stripe_platform_interface] - flutter_svg 0.22.0 [flutter meta path_drawing vector_math xml] - flutter_vector_icons 1.0.0 [flutter] - geocoding 2.0.4 [flutter geocoding_platform_interface] - geolocator 7.7.1 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web] - get_it 7.2.0 [async collection] - google_fonts 2.1.1 [flutter http path_provider crypto] - google_maps_flutter 2.1.2 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface] - google_mobile_ads 0.12.2+1 [meta flutter] - google_sign_in 5.2.4 [flutter google_sign_in_platform_interface google_sign_in_web] - html 0.15.0 [csslib source_span] - http 0.13.4 [async http_parser meta path] - http_auth 1.0.1 [http crypto convert] - image_picker 0.8.4+11 [flutter flutter_plugin_android_lifecycle image_picker_for_web image_picker_platform_interface] - intl 0.17.0 [clock path] - liquid_swipe 2.1.1 [flutter provider] - local_auth 1.1.11 [flutter flutter_plugin_android_lifecycle intl platform] - lottie 1.2.2 [archive flutter path vector_math] - media_info 0.10.0 [mime flutter] - mime 1.0.1 - mobx 2.0.6+1 [meta] - multi_image_picker 4.8.01 [flutter meta] - nb_utils 4.4.13 [flutter shared_preferences fluttertoast connectivity_plus] - onesignal_flutter 3.3.0 [flutter] - otp_text_field 1.1.2 [flutter] - package_info 2.0.2 [flutter] - path 1.8.0 - path_drawing 0.5.1+1 [vector_math meta path_parsing flutter] - path_provider 2.0.9 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows] - pay 1.0.6 [flutter flutter_localizations pay_android pay_ios pay_platform_interface meta] - percent_indicator 3.4.0 [flutter] - photo_view 0.12.0 [flutter] - qr_code_scanner 0.5.2 [js flutter flutter_web_plugins] - qr_flutter 4.0.0 [flutter qr] - sembast 3.2.0 [meta path synchronized] - share 2.0.4 [meta mime flutter] - showcaseview 1.1.5 [flutter] - signature 4.1.1 [flutter image] - simple_animations 3.2.0 [flutter supercharged flutter_lints] - sleek_circular_slider 2.0.1 [flutter] - sliding_up_panel 2.0.0+1 [flutter] - smooth_page_indicator 1.0.0+2 [flutter] - syncfusion_flutter_charts 19.4.55 [flutter intl vector_math syncfusion_flutter_core] - syncfusion_flutter_gauges 19.4.55 [flutter syncfusion_flutter_core intl] - syncfusion_flutter_pdfviewer 19.4.55-beta [flutter vector_math async http uuid syncfusion_flutter_pdfviewer_platform_interface syncfusion_flutter_pdfviewer_web syncfusion_flutter_pdfviewer_macos syncfusion_flutter_core syncfusion_flutter_pdf] - url_launcher 6.0.20 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - video_player 2.3.0 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web] - webview_flutter 2.8.0 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] - wechat_assets_picker 6.3.1 [flutter extended_image photo_manager provider video_player] - wechat_camera_picker 2.6.5 [flutter camera path path_provider photo_manager video_player] - youtube_player_flutter 8.0.0 [flutter flutter_inappwebview] dev dependencies: - build_runner 2.1.8 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph typed_data] - mobx_codegen 2.0.5+2 [analyzer build build_resolvers meta mobx path source_gen] transitive dependencies: - _fe_analyzer_shared 36.0.0 [meta] - analyzer 3.3.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - archive 3.2.2 [crypto path] - args 2.3.0 - async 2.8.2 [collection meta] - boolean_selector 2.1.0 [source_span string_scanner] - build 2.2.1 [analyzer async convert crypto glob logging meta path] - build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.0.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.0.6 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.3 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.1.4 [built_collection collection fixnum meta] - cached_network_image_platform_interface 1.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.0.1 [flutter flutter_cache_manager cached_network_image_platform_interface] - camera 0.9.4+16 [camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle quiver] - camera_platform_interface 2.1.5 [cross_file flutter plugin_platform_interface stream_transform] - camera_web 0.2.1+3 [camera_platform_interface flutter flutter_web_plugins stream_transform] - characters 1.2.0 - charcode 1.3.1 - checked_yaml 2.0.1 [json_annotation source_span yaml] - chewie_audio 1.3.0 [cupertino_icons flutter video_player] - clock 1.1.0 - cloud_firestore_platform_interface 5.5.1 [collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 2.6.10 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - code_builder 4.1.0 [built_collection built_value collection matcher meta] - connectivity_plus 2.2.1 [flutter connectivity_plus_platform_interface connectivity_plus_linux connectivity_plus_macos connectivity_plus_web connectivity_plus_windows] - connectivity_plus_linux 1.3.0 [flutter connectivity_plus_platform_interface meta nm] - connectivity_plus_macos 1.2.1 [connectivity_plus_platform_interface flutter] - connectivity_plus_platform_interface 1.2.0 [flutter meta plugin_platform_interface] - connectivity_plus_web 1.2.0 [connectivity_plus_platform_interface flutter_web_plugins flutter] - connectivity_plus_windows 1.2.0 [connectivity_plus_platform_interface flutter] - convert 3.0.1 [typed_data] - cross_file 0.3.2 [flutter js meta] - crypto 3.0.1 [collection typed_data] - csslib 0.17.1 [source_span] - dart_style 2.2.2 [analyzer args path pub_semver source_span] - dbus 0.7.1 [args ffi meta xml] - equatable 2.0.3 [collection meta] - extended_image 6.0.1 [extended_image_library flutter meta] - extended_image_library 3.1.2 [crypto flutter http_client_helper path path_provider] - fake_async 1.2.0 [clock collection] - ffi 1.1.2 - file 6.1.2 [meta path] - firebase_auth_platform_interface 6.2.1 [firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 3.3.9 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.2.5 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.6.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_messaging_platform_interface 3.2.1 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 2.2.9 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_storage_platform_interface 4.1.1 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.2.10 [async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - fixnum 1.0.0 - flutter_blurhash 0.6.4 [flutter] - flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_layout_grid 1.0.6 [flutter collection meta quiver] - flutter_lints 1.0.4 [lints] - flutter_local_notifications_linux 0.4.2 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories] - flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface] - flutter_math_fork 0.4.2+2 [flutter flutter_svg provider meta collection tuple] - flutter_plugin_android_lifecycle 2.0.5 [flutter] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta typed_data vector_math] - fluttertoast 8.0.9 [flutter flutter_web_plugins] - freezed_annotation 0.14.3 [collection json_annotation meta] - frontend_server_client 2.1.2 [async path] - geocoding_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - geolocator_android 2.1.0 [flutter geolocator_platform_interface] - geolocator_apple 1.2.2 [flutter geolocator_platform_interface] - geolocator_platform_interface 2.3.6 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.0.6 [flutter flutter_web_plugins geolocator_platform_interface] - glob 2.0.2 [async collection file path string_scanner] - google_maps_flutter_platform_interface 2.1.5 [collection flutter plugin_platform_interface stream_transform] - google_sign_in_platform_interface 2.1.2 [flutter quiver] - google_sign_in_web 0.10.0+5 [flutter flutter_web_plugins google_sign_in_platform_interface js] - graphs 2.1.0 [collection] - http_client_helper 2.0.2 [http] - http_multi_server 3.2.0 [async] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.1.3 [archive meta xml] - image_picker_for_web 2.1.6 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_platform_interface 2.4.4 [cross_file flutter http plugin_platform_interface] - io 1.0.3 [meta path string_scanner] - js 0.6.3 - json_annotation 4.4.0 [meta] - lints 1.0.1 - logging 1.0.2 - matcher 0.12.11 [stack_trace] - material_color_utilities 0.1.3 - meta 1.7.0 - modal_bottom_sheet 2.0.1 [flutter] - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - numerus 1.1.1 - octo_image 1.0.1 [flutter flutter_blurhash] - package_config 2.0.2 [path] - path_parsing 0.2.1 [vector_math meta] - path_provider_android 2.0.12 [flutter path_provider_platform_interface] - path_provider_ios 2.0.8 [flutter path_provider_platform_interface] - path_provider_linux 2.1.5 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.5 [flutter path_provider_platform_interface] - path_provider_platform_interface 2.0.3 [flutter platform plugin_platform_interface] - path_provider_windows 2.0.5 [ffi flutter path path_provider_platform_interface win32] - pay_android 1.0.5 [flutter flutter_localizations pay_platform_interface flutter_svg] - pay_ios 1.0.6 [flutter pay_platform_interface] - pay_platform_interface 1.0.2 [flutter yaml] - pedantic 1.11.1 - petitparser 4.4.0 [meta] - photo_manager 1.3.10 [flutter] - platform 3.1.0 - plugin_platform_interface 2.1.2 [meta] - pool 1.5.0 [async stack_trace] - process 4.2.4 [file path platform] - provider 6.0.2 [collection flutter nested] - pub_semver 2.1.1 [collection meta] - pubspec_parse 1.2.0 [checked_yaml collection json_annotation pub_semver yaml] - qr 2.1.0 [meta] - quiver 3.0.1+1 [matcher] - rxdart 0.27.3 - shared_preferences 2.0.13 [flutter shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shared_preferences_android 2.0.11 [flutter shared_preferences_platform_interface] - shared_preferences_ios 2.1.0 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.1.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_macos 2.0.3 [flutter shared_preferences_platform_interface] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.3 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.1.0 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.2.0 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.2.1 [analyzer async build dart_style glob meta path source_span yaml] - source_span 1.8.1 [collection path term_glyph] - sqflite 2.0.2 [flutter sqflite_common path] - sqflite_common 2.2.1 [synchronized path meta] - stack_trace 1.10.0 [path] - states_rebuilder 4.4.0 [flutter collection] - stream_channel 2.1.0 [async] - stream_transform 2.0.0 - string_scanner 1.1.0 [charcode source_span] - stripe_android 1.3.0 [flutter] - stripe_ios 1.3.0 [flutter] - stripe_platform_interface 1.3.0 [flutter freezed_annotation json_annotation meta plugin_platform_interface] - supercharged 2.1.1 [supercharged_dart flutter] - supercharged_dart 2.1.1 - syncfusion_flutter_core 19.4.55 [vector_math flutter] - syncfusion_flutter_pdf 19.4.55-beta [flutter intl xml syncfusion_flutter_core crypto convert] - syncfusion_flutter_pdfviewer_macos 19.4.55-beta [flutter syncfusion_flutter_pdfviewer_platform_interface] - syncfusion_flutter_pdfviewer_platform_interface 19.4.55-beta [flutter plugin_platform_interface] - syncfusion_flutter_pdfviewer_web 19.4.55-beta [flutter flutter_web_plugins js meta syncfusion_flutter_pdfviewer_platform_interface] - synchronized 3.0.0 - term_glyph 1.2.0 - test_api 0.4.8 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - timezone 0.8.0 [path] - timing 1.0.0 [json_annotation] - tuple 2.0.0 [quiver] - typed_data 1.3.0 [collection] - universal_platform 1.0.0+1 - url_launcher_android 6.0.15 [flutter url_launcher_platform_interface] - url_launcher_ios 6.0.15 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.0 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.0.5 [flutter plugin_platform_interface] - url_launcher_web 2.0.9 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.0 [flutter url_launcher_platform_interface] - uuid 3.0.6 [crypto] - vector_math 2.1.1 - very_good_analysis 2.4.0 - video_player_android 2.3.0 [flutter video_player_platform_interface] - video_player_avfoundation 2.3.0 [flutter video_player_platform_interface] - video_player_platform_interface 5.1.0 [flutter plugin_platform_interface] - video_player_web 2.0.7 [flutter flutter_web_plugins video_player_platform_interface] - wakelock 0.6.1+2 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows] - wakelock_macos 0.4.0 [flutter flutter_web_plugins wakelock_platform_interface] - wakelock_platform_interface 0.3.0 [flutter meta] - wakelock_web 0.4.0 [flutter flutter_web_plugins js wakelock_platform_interface] - wakelock_windows 0.2.0 [flutter wakelock_platform_interface win32] - watcher 1.0.1 [async path] - web_socket_channel 2.1.0 [async crypto stream_channel] - webview_flutter_android 2.8.3 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 1.8.1 [flutter plugin_platform_interface] - webview_flutter_wkwebview 2.7.1 [flutter webview_flutter_platform_interface] - win32 2.4.1 [ffi] - xdg_directories 0.2.0+1 [meta path process] - xml 5.3.1 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner] ```

darshankawar commented 2 years ago

@jgarrett77 Can you provide below details you are using in build.gradle file:

compileOptions
minSdkVersion
targetSdkVersion
jgarrett77 commented 2 years ago

compileOptions 31 minSdkVersion 21 targetSdkVersion 30

On Fri, Mar 25, 2022 at 5:21 AM darshankawar @.***> wrote:

@jgarrett77 https://github.com/jgarrett77 Can you provide below details you are using in build.gradle file:

compileOptions minSdkVersion targetSdkVersion

— Reply to this email directly, view it on GitHub https://github.com/firebase/flutterfire/issues/8324#issuecomment-1078816244, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHKFO47FFUKQVRB4GTQX2DVBWARDANCNFSM5ROYXT6Q . You are receiving this because you were mentioned.Message ID: @.***>

--

Jabari Garrett

The JCTS Group

"You Dream It, We Build It"

Technology | Executive Director

9701 Apollo Dr

Suite 301

Upper Marlboro, MD 20774

Office: 301.327.1831

Mobile: 301.485.6154

Email: @.***

Web: www.jctsgroup.com

jgarrett77 commented 2 years ago

I figured out the issue, the problem was in the app/build.gradle file I had to remove the following:

        compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
darshankawar commented 2 years ago

Thanks for the update and glad to know issue is resolved. Closing per above comment.