添加当前版本 27.0 :
27.0
dependencies { api "com.google.guava:guava:27.0-jre" }
和 exclude 其他两个版本 19.0 和 20.0 ,无论它们被引用的地方。
exclude
19.0
20.0
./gradlew app:dependencies > dependencies.txt
或检查:
./gradlew app:dependencies | grep guava
例如( firebase-admin 肯定是候选人):
firebase-admin
// https://mvnrepository.com/artifact/com.google.firebase/firebase-admin implementation ("com.google.firebase:firebase-admin:6.5.0") { exclude group: "com.google.guava", module: "guava" }
可能还有其他参考文献。
该 的 罐 强> 更新我的库依赖项后重新开始工作,并在从Github重新提取在不同机器上构建的版本时重新定义Project level SDK。
compile
implementation
buildscript { ext.kotlin_version = '1.3.10' ext.junitJupiterVersion = '5.3.2' repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.3' } } plugins { id 'java' id 'org.jetbrains.kotlin.jvm' version '1.2.51' } version '1.0-SNAPSHOT' sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testImplementation group: 'junit', name: 'junit', version: '5.3.2' // JUnit Jupiter API and TestEngine implementation testImplementation("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}") testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}") testImplementation "org.assertj:assertj-core:3.11.1" // To avoid compiler warnings about @API annotations in JUnit code testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0' implementation 'com.squareup.retrofit2:retrofit:2.5.0' implementation 'com.squareup.retrofit2:converter-gson:2.5.0' implementation 'com.squareup.retrofit2:adapter-rxjava:2.5.0' implementation 'io.reactivex.rxjava2:rxjava:2.2.4' implementation 'com.google.firebase:firebase-admin:6.6.0' implementation 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0' } compileKotlin { kotlinOptions.jvmTarget = "1.8" } compileTestKotlin { kotlinOptions.jvmTarget = "1.8" }