谷歌播放服务版本

时间:2016-04-29 21:56:33

标签: android gradle google-play-services

当我尝试执行buid.gradle时,我在android studio上收到此错误

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.

这是模块build.gradle文件

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.gs.lasarenas"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.google.android.gms:play-services:8.4.0'
}

在这个文件中,播放服务版本是8.4.0但我不知道我必须将版本从8.3.0更新到8.4.0

3 个答案:

答案 0 :(得分:4)

<强>更新

好好试试这个

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:design:25.0.0'
    compile 'com.google.android.gms:play-services:9.8.0'
}

apply plugin: 'com.google.gms.google-services'

最后添加'com.google.gms.google-services'为我解决了

希望有所帮助

答案 1 :(得分:0)

  1. 不要使用罐子
    • 删除此行compile fileTree(include: ['*.jar'], dir: 'libs')
  2. 请勿使用play-services
    • 请选择以下内容:play-services-analytics
  3. 例如:

    dependencies {
        compile 'com.android.support:appcompat-v7:23.3.0'
        compile 'com.android.support:design:23.3.0'
        compile 'com.google.android.gms:play-services-auth:8.4.0'
    
        testCompile 'junit:junit:4.12'
    }
    

答案 2 :(得分:0)

试试这个

compile 'com.google.android.gms:play-services-gcm:8.4.0'