首页 > 代码库 > Android Studio添加依赖编译报错

Android Studio添加依赖编译报错

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.

原因:由于添加的依赖版本是最新的,而代码仓库里边并没有最新的依赖导致报错

解决办法:在build.gradle中添加下面代码即可解决

configurations.all {
resolutionStrategy.force ‘com.google.code.findbugs:jsr305:3.0.1‘
}

Android Studio添加依赖编译报错