我正在尝试通过Flutter应用进行Firebase身份验证。
尝试在代码之前测试我的应用程序(在通过USB连接的Android手机上),并显示以下错误:
Shell:
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:
.......
答案 0 :(得分:0)
我认为问题出在Google服务版本中。只需将其替换为
com.google.gms:google-services:4.2.0
在build.grade
项目级别中,然后尝试。