MissingPluginException exception when I try to connect my app to firebase authentication

Viewed 2537

When I try to initialize firebase with my flutter project I get this 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)

At first I thought that it had something to do with the firebase core page but I've tried to use older page and I still get the same error

The complete error:

E/flutter ( 8415): [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)
E/flutter ( 8415): #0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:157
E/flutter ( 8415): <asynchronous suspension>
E/flutter ( 8415): #1      MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
E/flutter ( 8415): #2      MethodChannel.invokeListMethod
package:flutter/…/services/platform_channel.dart:345
E/flutter ( 8415): #3      MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:30:36)
E/flutter ( 8415): #4      MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:75:13)
E/flutter ( 8415): #5      Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:25)
E/flutter ( 8415): #6      main
package:crypto_wallet/main.dart:7
E/flutter ( 8415): #7      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:231:25)
E/flutter ( 8415): #8      _rootRun (dart:async/zone.dart:1190:13)
E/flutter ( 8415): #9      _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 8415): #10     _runZoned (dart:async/zone.dart:1630:10)
E/flutter ( 8415): #11     runZonedGuarded (dart:async/zone.dart:1618:12)
E/flutter ( 8415): #12     _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:223:5)
E/flutter ( 8415): #13     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
E/flutter ( 8415): #14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter ( 8415):

The dependencies :

dependencies:
  flutter:
    sdk: flutter
  firebase_core: "^0.5.0+1"
  firebase_auth: "^0.18.1+2"
  cloud_firestore: "^0.14.1+3" 

This is my main function:

void main () async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(MyApp());
}

the build.gradle file (dependencies)

 dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath 'com.google.gms:google-services:4.3.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    } 
1 Answers

I assume that you have the same issue as here. So you need to change the relevant part in your build.gradle file with the following:

          'com.android.tools.build:gradle:3.5.0'

You can read more from here.

Related