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.63k stars 3.95k forks source link

🐛 The plugin `firebase_core` uses a deprecated version of the Android embedding. #10877

Closed vickywagz closed 1 year ago

vickywagz commented 1 year ago

Bug report

The plugin firebase_core uses a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

Describe the bug A clear and concise description of what the bug is.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. '...'
  3. See error or incorrect behavior

Flutter version

Flutter 3.10.0-18.0.pre.17 • channel main • https://github.com/flutter/flutter.git Framework • revision 845c12fb10 (3 days ago) • 2023-04-29 16:02:06 -0400 Engine • revision 7806f8a4fb Tools • Dart 3.1.0 (build 3.1.0-56.0.dev) • DevTools 2.23.1

Firebase core version

firebase_core: ^2.10.0


Flutter doctor -v

Click To Expand ``` [√] Flutter (Channel main, 3.10.0-18.0.pre.17, on Microsoft Windows [Version 10.0.19044.2846], locale en-US) • Flutter version 3.10.0-18.0.pre.17 on channel main at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 845c12fb10 (3 days ago), 2023-04-29 16:02:06 -0400 • Engine revision 7806f8a4fb • Dart version 3.1.0 (build 3.1.0-56.0.dev) • DevTools version 2.23.1 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at C:\Users\enoch\AppData\Local\Android\sdk • Platform android-33-ext4, build-tools 33.0.1 • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.0) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.5.33414.496 • Windows 10 SDK version 10.0.22000.0 [√] Android Studio (version 2022.1) • Android Studio at C:\Program Files\Android\Android Studio1 • 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.15+0-b2043.56-8887301) [√] VS Code (version 1.77.3) • VS Code at C:\Users\enoch\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.58.0 [√] Connected device (4 available) • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.2846] • Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.138 • Edge (web) • edge • web-javascript • Microsoft Edge 112.0.1722.58 [√] Network resources • All expected network resources are available. • No issues found! ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 3.1.0-56.0.dev Flutter SDK 3.10.0-18.0.pre.17 journal 1.0.0+1 dependencies: - cupertino_icons 1.0.5 - firebase_core 2.10.0 [firebase_core_platform_interface firebase_core_web flutter meta] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] dev dependencies: - flutter_lints 2.0.1 [lints] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] transitive dependencies: - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - characters 1.3.0 - clock 1.1.1 - collection 1.17.1 - fake_async 1.3.1 [clock collection] - firebase_core_platform_interface 4.6.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.3.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - js 0.6.7 [meta] - lints 2.1.0 - matcher 0.12.15 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.3.0 [collection] - meta 1.9.1 - path 1.8.3 - plugin_platform_interface 2.1.4 [meta] - sky_engine 0.0.99 - source_span 1.10.0 [collection path term_glyph] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - string_scanner 1.2.0 [source_span] - term_glyph 1.2.1 - test_api 0.5.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - vector_math 2.1.4 ```

danagbemava-nc commented 1 year ago

Hi @vickywagz, what version of firebase_core & flutter are you using?

Please provide the output of flutter doctor -v && flutter pub deps -- --style=compact

Thank you

vickywagz commented 1 year ago

Hi @danagbemava-nc i have updated my comment

danagbemava-nc commented 1 year ago

Hi @vickywagz, can you try clearing your pub cache and running flutter pub get in your project again? The firebase_core plugin has already been updated to use the new version of the android embedding.

vickywagz commented 1 year ago

Hi @danagbemava-nc thank you alot after doing what you asked me to do I'm no longer getting the error.

danagbemava-nc commented 1 year ago

Closing this since the issue has been resolved.

ahmed-raza-92 commented 1 year ago

@danagbemava-nc I have followed your instruction but i am still facing the issue.

danagbemava-nc commented 1 year ago

The firebase_core plugin is already using the new version of the android embedding, you'll need to make sure you're using the updated version of the plugin and make sure that your packages are not depending on older versions of the plugin. You'll also need to make sure that your cache is updated

ahmed-raza-92 commented 1 year ago

The plugin version was latest. I updated the flutter and android studio version to latest then this got this issue but somehow managed to solve this issue. But thanks for it.