1

我正在嘗試開發一款應用程序,其中一項活動從Google工作表中提取數據。我下面的添加Google API後發生Gradle錯誤

Android Quickstart

然而,快速入門指南,在步驟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'. 

錯誤未顯示在工作區本身上,所以我非常困惑錯誤的位置。任何人都可以幫我解決這個問題嗎?

非常感謝!

回答

相關問題