MissingPluginException exception when a firebase anonymous sign-in with flutter (windows) app

6,811

Solution 1

Late to the party, but the actual issue is that flutter_core does not actually support Windows.
It only supports Android, iOS, MacOS & Web (See the firebase_core package on pub.dev).

enter image description here

Solution 2

You are just hot reloading or hot restarting your flutter after adding the await Firebase.initializeApp(); in your void main() function.

Just Stop your main.dart process and run it again from the begining -- thats it, now your app gets integrated with firebase!

note: during running some may face issues with the Multidex error refer link: D8: Cannot fit requested classes in a single dex file (# methods: 71610 > 65536) to solve the error or just add:

in your project level >> android >> app >> build.gradle :

defaultConfig {
...

multiDexEnabled true

}

Solution 3

incase your running the app on android and your MainActivity has this import statement:

import io.flutter.app.FlutterActivity  

you might have to change it to this instead:

import io.flutter.embedding.android.FlutterActivity
Share:
6,811
Hardik Sachan
Author by

Hardik Sachan

Updated on December 24, 2022

Comments

  • Hardik Sachan
    Hardik Sachan over 1 year

    I recently started out with flutter for windows. I'm following this firebase and flutter tutorial. At lecture 4, I am getting error with Firebase Auth:

    flutter: MissingPluginException(No implementation found for method signInAnonymously on channel plugins.flutter.io/firebase_auth)

    I think the problem is because I am building for windows. I don't know how to add firebase to windows application. Any help is appreciated

    Here is the complete log:

    Launching lib\main.dart on Windows in debug mode...
    Building Windows application...
    Waiting for Windows to report its views...
    Debug service listening on ws://127.0.0.1:60688/97Ok8iT1Hjo=/ws
    Syncing files to device Windows...
    flutter: MissingPluginException(No implementation found for method signInAnonymously on channel plugins.flutter.io/firebase_auth)
    flutter: error signing in
    

    EDIT 1

    pubspec.yaml file (dependencies section)

    dependencies:
      flutter:
        sdk: flutter
      firebase_auth: ^0.14.0+5
      cloud_firestore: ^0.12.9+4
    

    EDIT 2

    I updated the dependencies to use following versions:

      firebase_auth: ^0.18.1+2
      cloud_firestore: ^0.14.1+3
      firebase_core: ^0.5.0+1
    

    But now I am getting the following error:

    [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
    

    This is what my main function looks like:

    void main() async {
      WidgetsFlutterBinding.ensureInitialized();
      await Firebase.initializeApp();
      runApp(MyApp());
    }
    
  • Hardik Sachan
    Hardik Sachan over 3 years
    But I am trying to use it in windows build. How do I initialize firebase for windows build?
  • Akif
    Akif over 3 years
    There is a package fb_auth. You can check it. pub.dev/packages/fb_auth. As they noticed in the package info, it works on Windows too.
  • Hardik Sachan
    Hardik Sachan over 3 years
    Is there a similar package for firestore as well?