android - 如何解决错误 gradle sync 使其他各种库请求的库失败?
问题描述
我想在我的项目中实现 firestore,但是在添加以下行后,我的 gradle 同步失败
implementation 'com.google.firebase:firebase-firestore:17.1.2'
我得到了错误
Gradle sync failed: The library com.google.android.gms:play-services-basement 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.
Consult IDE log for more details (Help | Show Log)
这个错误是什么以及如何解决它我正在使用的类路径是
classpath 'com.google.gms:google-services:4.1.0'
解决方案
检查此 gradle 文件以了解项目级别
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
推荐阅读
- r - 仅获取第一行匹配特定字符串 - R
- r - 将回归线添加到绘制的矩阵
- python - 如何在 Python 中给定结果列表进行高斯分布(密度概率)估计?
- javascript - 如何在 JavaScript 中解析大型 JSON 流中的项目?
- java - 尝试模拟时出现 java.lang.ExceptionInInitializerError
- regex - grep中的正则表达式不尊重条件子句?
- sql-server - 处理来自存储过程结果 API 的 JSON
- javascript - 选择中的静态文本
- c++ - 可变参数模板:每个模板参数一个方法
- javascript - 使用多个选项划分数字的最有效方法