简体   繁体   English

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

From the run terminal of android studio:从android studio的运行终端:

FAILURE: Build failed with an exception. FAILURE:构建失败,出现异常。

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

  • What went wrong: A problem occurred configuring project ':cloud_firestore_web'.出了什么问题:配置项目“:cloud_firestore_web”时出现问题。

Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.无法在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找到参数 [project ':firebase_core'] 的方法 implementation()。

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志输出。 Run with --scan to get full insights.使用 --scan 运行以获得完整的见解。

Similar issue with firebase_auth. firebase_auth 的类似问题。

Had a similar problem recently, here are the steps that fixed it for me.最近遇到了类似的问题,以下是为我修复它的步骤。

  1. Run flutter pub upgrade to upgrade all the Firebase plugins to the latest versions.运行 flutter pub upgrade 将所有 Firebase 插件升级到最新版本。

  2. Use the steps at https://firebase.flutter.dev/docs/migration to check for any deprecated code.使用https://firebase.flutter.dev/docs/migration 中的步骤检查任何已弃用的代码。

  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/build.gradle 文件中,确保 google services 依赖项是classpath 'com.google.gms:google-services:4.3.3'或任何最新版本。

  4. 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在 android/app/build.gradle 文件中,如果您有表单implementation 'com.google.firebase:[firebase-product:version-number]任何依赖项,则删除这些行

  5. Run flutter clean运行 flutter clean

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pubspec.yaml:在添加 cloud_firestore 时解析块映射时需要一个键 - pubspec.yaml: Expected a key while parsing a block mapping when adding cloud_firestore 使用 cloud_firestore 和 firebase_core 解决 Flutter 版本问题失败 - Flutter version solving failed with cloud_firestore and firebase_core Flutter 中的 cloud_firestore 和 firebase_auth 兼容性问题 - cloud_firestore and firebase_auth compatiblity issue in Flutter 当我添加到 pubspec.yaml 时 firebase auth 出现问题 - problem with firebase auth when i added to pubspec.yaml 在将 Firebase 云消息传递依赖项添加到 PubSpec.yaml -Flutter 时构建应用程序失败 - App fails when building upon adding Firebase Cloud Messaging Dependency to PubSpec.yaml -Flutter Firebase_auth 取决于 firebase_core 错误 - Firebase_auth depends on firebase_core error 我无法在 Flutter 中同时添加 cloud_firestore 和 firebase_auth - I cannot add cloud_firestore and firebase_auth together in Flutter 如何为我的 flutter 项目找到兼容的依赖版本? (Firebase_auth、cloud_firestore、intl、flutter_dialogflow_v2) - How can I find compatible dependency versions for my flutter project? (Firebase_auth, cloud_firestore, intl, flutter_dialogflow_v2) Flutter-Firebase 构建失败':cloud_firestore:compileDebugJavaWithJavac' - Flutter-Firebase Build Failed ':cloud_firestore:compileDebugJavaWithJavac' Flutter 依赖冲突将 firebase-admin 添加到我的 pubspec.yaml - Flutter dependency conflict adding firebase-admin to my pubspec.yaml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM