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如果它解決了您的問題,請將其標記爲答案。它可以幫助其他用戶 –