简体   繁体   中英

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

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:todo_firebase/auth/authscreen.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:todo_firebase/screens/home.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Firebase.initializeApp();
  //initilization of Firebase app

  // other Firebase service initialization

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: StreamBuilder(
        stream: FirebaseAuth.instance.authStateChanges(),
        builder: (context, usersnapshot) {
          if (usersnapshot.hasData) {
            return Home();
          } else {
            return AuthScreen();
          }
        },
      ),
      debugShowCheckedModeBanner: false,
      theme: ThemeData(brightness: Brightness.light, primaryColor: Colors.blue),
      // ignore: dead_code
    );
  }
}

This is my main.dart code. I get the following output at 'await Firebase.initializeApp()': MissingPluginException (MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core))

I'm trying to make a daily task app but whenever I execute it using VSCode, it builds a Windows Application that appears blank. I've written the whole code in the different sections of lib (authentication and homepage), main.dart, and pubspec.yaml but it is not executing. Kindly provide the method to fix the error, and make my app work.

Had this issue this morning.. What a problem it was! Took me a few hours to figure out. Everything is working now though!

What did I do? I tried cleaning my project out, deleted ios file and ran flutter create . a few times with no luck... Pulled my hair out!

What fixed it?

  • update your gems
  • delete ios file for the 5th time (LOL)
  • delete "derived data" in xcode and clean build folder in xcode

run flutter clean inside your project and then run flutter pub cache repair

Then you need to manually update your pubspec.yaml with the latest version of firebase core, etc. Yes make sure you delete lock file first then manually update the dependencies. DO NOT run flutter pub upgrade . Won't work.. Just manually add them in :(

This is what I manually added into my pubspec.yaml:

cloud_firestore: ^3.2.1
firebase_core: ^1.19.1
firebase_storage: ^10.3.1
firebase_auth: ^3.4.1
firebase_messaging: ^11.4.4

First of all your app is not running on device If running then stop it and then Fire these command Flutter clean Then Flutter pub get

Then run your project

There seems to be a problem with the latest firebase_core version 1.19.0 Try to use the previous version:

firebase_core: ^1.18.0

At least this solved the problem 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.

Related Question MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core) on Android missingpluginexception(no implementation found for method firebase#initializecore on channel plugins.flutter.io/firebase_core) Unhandled Exception MissingPluginException: No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core) release mode MissingPluginException (MissingPluginException(No implementation found for method camera#animate on channel plugins.flutter.io/google_maps_53)) Unhandled Exception: MissingPluginException(No implementation found for method X on channel plugins.flutter.io/Y) MissingPluginException(No implementation found for method init on channel plugins.flutter.io/google_sign_in) MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider) FLUTTER Unhandled Exception: MissingPluginException(No implementation found for method map#waitForMap on channel plugins.flutter.io/google_maps_0) Flutter Unhandled Exception: MissingPluginException(No implementation found for method pickImage on channel plugins.flutter.io/image_picker) Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM