当前位置: 首页 > 知识库问答 >
问题:

尝试将我的应用程序连接到firebase身份验证时出现MissingPluginException异常

宫子晋
2023-03-14

当我尝试用我的颤振项目初始化firebase时,我得到以下错误:

[错误:flatter/lib/ui/ui_dart_state.cc(177)]未处理的异常:缺少PluginException(未找到通道插件上的方法Firebase#initializeCore.flatter.io/Firebase_core的实现)

起初我认为它有一些做与Firebase核心页面但我尝试使用旧的页面我仍然得到同样的错误

完全错误:

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):

依赖项:

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

这是我的主要功能

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

建造。渐变文件(依赖项)

 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个答案

孟承嗣
2023-03-14

我想你也有同样的问题。因此,您需要更改构建中的相关部分。具有以下内容的渐变文件:

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

你可以从这里读到更多。

 类似资料: