gpt4 book ai didi

android - flutter gradle异常退出(firebase认证)

转载 作者:行者123 更新时间:2023-11-30 05:05:10 24 4
gpt4 key购买 nike

我正在尝试使用我的 flutter 应用程序进行 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:
.......

最佳答案

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

com.google.gms:google-services:4.2.0

build.grade项目级别然后尝试。

关于android - flutter gradle异常退出(firebase认证),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54698026/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com