简体   繁体   中英

FlutterEnginePluginRegistry - problem to register plugin Firebase in Flutter app

I can't launch a Flutter project in Android Emulator after upgrade Flutter. I obtain the following message in the debug console:

W/FlutterEnginePluginRegistry( 7750): Attempted to register plugin (io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry$ShimRegistrarAggregate@75e268b) but it was already registered with this FlutterEngine (io.flutter.embedding.engine.FlutterEngine@d56f368).

It worked fine before Flutter upgrade. I detected that the problem is with Firebase plugins. I created a new empty Flutter project and it works ok. After add firebase_auth plugin, I obtain the above messge again.

I tried to clean the project, different Firebase versions, restart and create new emulators, ...

My flutter version:

[√] Flutter (Channel master, v1.14.5-pre.28, on Microsoft Windows [Versión 10.0.17763.973], locale es-ES)
    • Flutter version 1.14.5-pre.28 at C:\src\flutter
    • Framework revision 93a5b7d419 (2 hours ago), 2020-01-25 01:23:01 -0800
    • Engine revision 4218f8026f
    • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\Usuario\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.41.1)
    • VS Code at C:\Users\Usuario\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.7.1

[√] Connected device (1 available)
    • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 10 (API 29) (emulator)

• No issues found!

And my pubspec.yaml

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  firebase_auth: ^0.15.3+1

Has anyone had this problem? Thanks

According to the output of flutter doctor, you are using the master channel.

From the documentation:

master

The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things.

Therefore you might have some issues, and it seems this is one of them.


You can use the stable channel for now:

stable

When we believe we have a particularly good build, we promote it to the stable channel. We intend to do this more or less every quarter, but this may vary. We recommend that you use this channel for all production app releases. We may ship hotfixes to the stable channel for high-priority bugs, although our intent is to do this rarely.

Latest version released was v1.12.13+hotfix.5

https://github.com/flutter/flutter/wiki/Flutter-build-release-channels

https://flutter.dev/docs/development/tools/sdk/releases

You can switch channel by executing:

flutter channel stable

I have also get these problems after updating this but i solved this problesm using both these commands

  1. flutter channel stable
  2. flutter packages get

Had a similar issue with AndroidAlarmManagerPlugin.

Deleting "AlarmService.setPluginRegistrant(this);" in Application's onCreate fixed it for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM