错误:与依赖关系冲突'com.google.code.findbugs:jsr305' [英] Error:Conflict with dependency 'com.google.code.findbugs:jsr305'

查看:2423
本文介绍了错误:与依赖关系冲突'com.google.code.findbugs:jsr305'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I created a new project in Android Studio 2.2 Preview 1 with Android App and Backend module with Google Messaging. This is the app file:

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')
}

但是它提供了:

But it's giving:


错误:与依赖关系com.google.code.findbugs:jsr305冲突。应用程序(1.3.9)和测试应用程序(2.0.1)的已解决版本不同。请参阅 http://g.co/androidstudio/app-test-app-conflict详细信息。

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

I am new to Android and not able to find what is this error. How do I fix it?

推荐答案

在您的应用程序的 build.gradle 添加以下内容:

In your app's build.gradle add the following:

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




强制Gradle只编译您为所有依赖关系声明的版本号,而不管依赖关系已声明的版本号。

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

这篇关于错误:与依赖关系冲突'com.google.code.findbugs:jsr305'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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