3

你好我在构建我的构建gradle时遇到以下错误。编译播放服务时出现版本冲突错误-gcm:8.4.0

Error:Gradle: 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/)

这里是我的构建文件:

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.2.3' 
    } 
} 
apply plugin: 'com.android.application' 
apply plugin: 'com.google.gms.google-services' 

repositories { 
    jcenter() 
} 

android { 
    compileSdkVersion 21 
    buildToolsVersion "21.1.2" 

    defaultConfig { 
     applicationId "com.games.ultimatetictactoe.app" 
     minSdkVersion 21 
     versionCode 12 
     versionName "1.1" 
    } 

    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_7 
     targetCompatibility JavaVersion.VERSION_1_7 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    packagingOptions{ 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.google.android.gms:play-services-gcm:8.4.0' 
    compile 'com.firebase:firebase-client-android:2.4.1' 
    compile 'com.firebase:firebase-token-generator:2.0.0' 
} 

我一直在看几个答案,但他们不是我应该怎么解决我的gradle构建为了解决这个问题完全清楚。

+0

我编译通过使用8.3.0 –

回答

1

在依赖与

classpath 'com.google.gms:google-services:2.0.0-alpha5' 

此外,由于您使用的是支持库更改您的谷歌服务V23你有API 23

使用

compileSdkVersion 23 
+0

解决这个问题,谢谢。这真的有效!我也改变了compiledSdkVersion和我的应用程序运行良好谢谢你!!!!! –

+0

@JeanCarlosHenriquez如果它解决了您的问题,请将其标记为答案。它可以帮助其他用户 –