flutter firebase MissingPluginException

1,778

If anyone else had the same issue as me

I've fixed the issue by creating another project and added the sh1 and sh256 to firebase just follow this tuto it's really helpful https://www.youtube.com/watch?v=CpyALC8Zpxo

PS: when u add firebase to your flutter project don't run it on chrome debug you will get an error, run it on your emulator or smartphone

happy coding ^^

Share:
1,778
Wassef Hassine
Author by

Wassef Hassine

Updated on December 31, 2022

Comments

  • Wassef Hassine
    Wassef Hassine over 1 year

    I just added firebase to my flutter App, i followed all the steps correctly, but i'm getting an error when initializing the app

    this is my code to initialize app

    void main() async {
      WidgetsFlutterBinding.ensureInitialized();
      await Firebase.initializeApp();
      runApp(MyApp());
    }
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          debugShowCheckedModeBanner: false,
          theme: new ThemeData(
            canvasColor: Colors.white,
          ),
          home: PersistentTabsDemo(),
          onGenerateRoute: route.controller,
        );
      }
    }
    

    this are the dependecies i added to pubsec.yaml

      firebase_core: ^1.6.0
      firebase_analytics: ^8.3.1
      firebase_auth: ^3.1.0
      cloud_firestore: ^2.5.1
    

    and this is the error

    Error: MissingPluginException(No implementation found for method Firebase#initializeCore on channel
    plugins.flutter.io/firebase_core)
    

    Edit: i tried removing async and await from my main class now i'm getting new error

    No firebase App 'default' has been created - call Firebase.intializeApp() 
    
    • Hasib Akon
      Hasib Akon over 2 years
      Restart android studio . Check sh1 key is added to firebase setting.And did you added json file to android /app directory.
    • Wassef Hassine
      Wassef Hassine over 2 years
      yes i've already done all of that
    • Peter Obiechina
      Peter Obiechina over 2 years
      Are you running the app on windows?
  • Wassef Hassine
    Wassef Hassine over 2 years
    @Kanak Joshi yes i'am runing it on windows
  • tazboy
    tazboy about 2 years
    Right, but that's the problem. It's not working on Chrome. Any success on getting it to work on Chrome yet?