小编典典

使用Firebase时颤振中的摇篮问题

flutter

在我的flutter应用程序中,我正在将firebase_auth用于google_sign_in,并且工作正常。但是,当我将cloud_firestore:添加到pubspec.yaml然后获取依赖项,然后重新启动我的应用程序时,它显示出如下错误:

FAILURE: Build failed with an exception.

* What went wrong:
The library com.google.android.gms:play-services-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Finished with error: Gradle build failed: 1

阅读 273

收藏
2020-08-13

共1个答案

小编典典

我已经在我的android / build.gradle文件中使用了这种依赖关系

classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'

并在pubspec.yaml中将此版本用于Firebase和google

firebase_auth: 0.5.11
google_sign_in: 3.0.4
cloud_firestore: 0.7.3

之所以能正常工作,是因为在这些版本上,gradle工具已更新为与Android Studio 3.1.2匹配。

其他Firebase工作版本:

firebase_admob: 0.5.5
firebase_analytic: 1.0.1
firebase_core: 0.2.4 
firebase_database: 1.0.1 
firebase_dynamic_links: 0.02
firebase_messaging: 1.0.2
firebase_performance: 0.0.3
firebase_remote_config: 0.0.4
firebase_storage: 0.3.7
2020-08-13