1

我是新来的android工作室,我正在尝试添加Google工作表api v4。 On their website它说要添加一些依赖到我的build.gradle文件。 这里是我的gradle这个目前看起来像:添加依赖到我的build.gradle在android工作室(与依赖关系冲突)

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 
    defaultConfig { 
     applicationId "com.example" 
     minSdkVersion 16 
     targetSdkVersion 26 
     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.google.android.gms:play-services-location:11.0.4' 
    compile 'com.android.support:appcompat-v7:26.+' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.android.gms:play-services-maps:11.0.4' 
    compile 'com.android.support:design:26.+' 

    testCompile 'junit:junit:4.12' 
} 

,当我尝试添加以下行

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-rev483-1.22.0') { 
    exclude group: 'org.apache.httpcomponents' 
} 

当我尝试同步我的摇篮我,而不是得到这个错误出现的错误

Error:Conflict with dependency 'com.google.code.findbugs:jsr305' in project ':app'. 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 studio很新颖。

+0

[错误的可能重复:冲突与依赖“com.google.code.findbugs: JSR305' ](https://stackoverflow.com/questions/37347326/errorconflict-with-dependency-com-google-code-findbugsjsr305) – DeKaNszn

回答