gpt4 book ai didi

android-studio - 错误:Conflict with dependency 'com.google.code.findbugs:jsr305'

转载 作者:行者123 更新时间:2023-12-03 04:06:57 27 4
gpt4 key购买 nike

我在 Android Studio 2.2 Preview 1 中使用 Android 应用程序和带有 Google Messaging 的后端模块创建了一个新项目。这是应用程序文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
compile project(path: ':backend', configuration: 'android-endpoints')
}

但它正在给予:

Error:Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (1.3.9) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

我是 Android 新手,无法找到此错误是什么。我该如何修复它?

最佳答案

在应用的 build.gradle 中添加以下内容:

android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}

Enforces Gradle to only compile the version number you state for all dependencies, no matter which version number the dependencies have stated.

关于android-studio - 错误:Conflict with dependency 'com.google.code.findbugs:jsr305' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37347326/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com