2017-08-08 61 views
0

我正在構建一個Android應用程序來存儲谷歌驅動器中的文本文件。根據我的觀點,代碼是確定的。但是,當我把谷歌播放服務的應用程序級別依賴項,它會在應用程序級版本依賴項中引發錯誤。由於這個原因,我無法同步gradle。我認爲錯誤與版本號有關。 這裏是發揮服務依賴我把 「編譯‘com.google.android.gms:發揮服務:8.4.0’」Android谷歌播放服務的正確版本

這是顯示爲錯誤,當我把上面的依賴的依賴 「編譯 'com.android.support:appcompat-v7:23.4.0'」

這裏是我的應用程序級graddle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.xxxxx.calllogtogoogledrive" 
     minSdkVersion 19 
     targetSdkVersion 23 
     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:23.4.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 
    compile 'com.google.android.gms:play-services:8.4.0' 
} 

下面是該項目的gradle水平

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.2' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

回答

0

你可以嘗試像這樣改變你的build.gradle;

allprojects { 
    repositories { 
     maven { url "http://jcenter.bintray.com" } 
    } 

刪除jcenter()加入此項。

+0

編譯錯誤消失。現在有運行時錯誤。 –

+0

你能告訴我嗎? –

相關問題