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

14.1k views Asked by At

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());
}
5

There are 5 answers

3
Akif On

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)

As mentioned in here, You need to set com.android.tools.build:gradle:3.5.0 in your dependencies in android/build.gradle.

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
    // ...
}
1
Ali Salhab On

make sure you enable signin method in console firebase https://console.firebase.google.com

0
Peter Wauyo On

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
0
Sound Conception On

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

0
Kishore Shiva On

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

}