11

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
  • 131
  • 1
  • 1
  • 8

5 Answers5

5

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

}

Kishore Shiva
  • 59
  • 1
  • 4
5

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

Sound Conception
  • 5,263
  • 5
  • 30
  • 47
1

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
Peter Wauyo
  • 827
  • 1
  • 8
  • 11
1

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

Ali Salhab
  • 21
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 05 '22 at 07:30
-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)

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'
    // ...
}
Akif
  • 7,098
  • 7
  • 27
  • 53