在pubspec.yaml文件中添加firebase_auth或cloud_firestore时,构建失败,但发生异常(firebase_core正在运行): [英] Build Failing with an exception when adding firebase_auth or cloud_firestore in the pubspec.yaml file (firebase_core is working):

查看:86
本文介绍了在pubspec.yaml文件中添加firebase_auth或cloud_firestore时,构建失败,但发生异常(firebase_core正在运行):的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在android studio的运行终端中:

From the run terminal of android studio:

失败:构建失败,并出现异常.

FAILURE: Build failed with an exception.

  • 其中:脚本'C:\ Flutter \ src \ flutter \ packages \ flutter_tools \ gradle \ flutter.gradle'行:362

  • Where: Script 'C:\Flutter\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 362

出了什么问题:配置项目':cloud_firestore_web'时发生问题.

What went wrong: A problem occurred configuring project ':cloud_firestore_web'.

在类型为org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler的对象上找不到参数[project':firebase_core']的方法Implementation().

Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行,以获取更多日志输出.与--scan一起运行以获得完整的见解.
  • firebase_auth的类似问题.

    Similar issue with firebase_auth.

    推荐答案

    最近有一个类似的问题,以下是为我修复的步骤.

    Had a similar problem recently, here are the steps that fixed it for me.

    1. 运行flutter pub upgrade,将所有Firebase插件升级到最新版本.

    1. Run flutter pub upgrade to upgrade all the Firebase plugins to the latest versions.

    使用 https://firebase.flutter.dev/docs/migration 检查是否已弃用任何代码.

    Use the steps at https://firebase.flutter.dev/docs/migration to check for any deprecated code.

    在android/build.gradle文件中,确保google services依赖项为 classpath'com.google.gms:google-services:4.3.3'或任何最新版本是.

    In the android/build.gradle file, make sure the google services dependency is classpath 'com.google.gms:google-services:4.3.3' or whatever the latest version is.

    在android/app/build.gradle文件中,如果您具有以下形式的依赖项实现'com.google.firebase:[firebase-product:version-number] ,然后删除这些行

    In the android/app/build.gradle file, if you have any dependencies of the form implementation 'com.google.firebase:[firebase-product:version-number] then get rid of those lines

    干净地扑打

    这篇关于在pubspec.yaml文件中添加firebase_auth或cloud_firestore时,构建失败,但发生异常(firebase_core正在运行):的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆