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

今天突然之间加了一个rxlifecycle包后出现了一个警告错误:

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

解决方案:
在app下的build.gradle中的Android目录下添加如下代码:

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.example.test"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
}

ok!就这样点击同步按钮就解决了。

你可能感兴趣的:(错误Conflict with dependency 'com.google.code.findbugs:jsr305')