使用Firebase时颤振中的Gradle问题 [英] Gradle issue in flutter when using firebase

查看:73
本文介绍了使用Firebase时颤振中的Gradle问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In my flutter application i am using firebase_auth for google_sign_in and it is working fine. But when i add cloud_firestore: to pubspec.yaml then get dependencies and then restart my app it show me an error like this:

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

推荐答案

我在我的android/build.gradle文件中使用了此依赖项

I have used this dependencies in my android/build.gradle file

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

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

and used this version for firebase and google in pubspec.yaml

firebase_auth: 0.5.11
google_sign_in: 3.0.4
cloud_firestore: 0.7.3  

它可以正常工作,因为在这些版本上,gradle工具已更新为与Android Studio 3.1.2匹配.

It works fine because at these versions gradle tooling was updated to match Android Studio 3.1.2.

其他firebase工作版本:

Other firebase working versions:

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

这篇关于使用Firebase时颤振中的Gradle问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆