我正在尝试开发一个应用程序,其中一个活动从谷歌工作表中提取数据。我正在关注
中的快速入门指南然而,在第4步中,我不想用他们的建议替换我的所有gradle设置,因为我已经开发了更高版本的SDK,所以我只是从他们的依赖项添加必要的编译行,所以我的gradle.app看起来像这样
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.erik.icaregg"
minSdkVersion 15
targetSdkVersion 25
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'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.android.support:support-v4:25.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-auth:9.8.0'
compile 'pub.devrel:easypermissions:0.1.5'
compile('com.google.api-client:google-api-client-android:1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-sheets:v4-rev38-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
testCompile 'junit:junit:4.12'
}
当我尝试使用gradle运行应用程序或同步项目时,构建总是会出现错误并且消息是
Error:14:21:26.378 [ERROR] [org.gradle.api.Task] 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.
14:21:26.396 [ERROR] [org.gradle.BuildExceptionReporter]
14:21:26.396 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
14:21:26.397 [ERROR] [org.gradle.BuildExceptionReporter]
14:21:26.397 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
14:21:26.397 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':app:prepareDebugAndroidTestDependencies'.
14:21:26.397 [ERROR] [org.gradle.BuildExceptionReporter] > Dependency Error. See console for details.
14:21:26.398 [ERROR] [org.gradle.BuildExceptionReporter]
14:21:26.398 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
14:21:26.399 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:prepareDebugAndroidTestDependencies'.
错误没有显示在工作区本身,所以我真的很困惑错误所在的位置。任何人都可以帮我解决这个问题吗?
非常感谢!
答案 0 :(得分:0)
如果有人遇到这个...... @gbhall在这里发布了一个很棒的答案
Error:Conflict with dependency 'com.google.code.findbugs:jsr305'