【问题标题】:flutter gradle exited abnormally (firebase authentication)flutter gradle 异常退出(firebase 身份验证)
【发布时间】:2023-03-09 02:20:01
【问题描述】:

我正在尝试使用我的颤振应用进行 Firebase 身份验证。

  • 在 firebase 上注册了我的应用。
  • 将 googleservices.json 复制到应用目录中。
  • 按照 Firebase 的指示复制依赖项。

尝试在代码之前测试我的应用程序(在通过 USB 连接的我的 android 手机上),并显示以下错误:

壳牌:

Initializing gradle...                                       3.6s

Resolving dependencies...

* Error running Gradle:
ProcessException: Process "/Volumes/data/Developoment/apps/firebase_pangey/android/gradlew"
exited abnormally:

FAILURE: Build failed with an exception.

* Where:
Build file '/Volumes/data/Developoment/apps/firebase_pangey/android/app/build.gradle' line:
62
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method classpath() for arguments [com.google.gms:google-services:4.0.1] on
project ':app' of type org.gradle.api.Project.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to
get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
  Command: /Volumes/data/Developoment/apps/firebase_pangey/android/gradlew app:properties
Please review your Gradle project setup in the android/ folder.

Pubspec.yaml 文件

name: firebase_pangey
description: A new Flutter proj
version: 1.0.0+1

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

  firebase_core: ^0.3.0+1
  firebase_analytics: ^2.0.1

  firebase_auth: ^0.8.1
  google_sign_in: ^4.0.1

  rxdart: ^0.20.0

dev_dependencies:
.......

【问题讨论】:

    标签: android firebase gradle flutter


    【解决方案1】:

    我认为问题出在谷歌服务版本中。只需将其替换为

    com.google.gms:google-services:4.2.0
    

    build.grade项目级别再试试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-25
      • 1970-01-01
      • 2019-01-05
      • 1970-01-01
      • 2019-09-30
      • 2022-01-11
      • 2021-06-10
      相关资源
      最近更新 更多