2017-03-16 69 views
0

我已經添加了一個空的谷歌地圖活動,我在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 10.0.1. 

我的應用程序級的build.gradle文件包含:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.2" 
defaultConfig { 
    applicationId "XXXXXXXXXX" 
    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.1.1' 
compile 'com.google.firebase:firebase-auth:10.0.1' 
compile 'com.android.support:design:25.1.1' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.google.android.gms:play-services-maps:10.2.0' 
testCompile 'junit:junit:4.12' 
} 







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

我的項目級的build.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.0' 
    classpath 'com.google.gms:google-services:3.0.0' 

    // 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

錯誤showas正是有您應用中的播放服務,與新的衝突的的另一個版本相同的版本庫,請確保沒有其他依賴於你的應用 – warlock

+0

如果你已經使用它從庫中刪除任何谷歌播放服務jar –

+0

可能與firebase-auth lib的版本有關,你應該嘗試使用基於播放服務的相同版本的庫。 – MatPag

回答

1

更新包com.google.firebase:firebase-auth:10.0.1com.google.firebase:firebase-auth:10.2.0的。

你應該嘗試使用基於播放服務,以避免衝突

1

除了使用compile 'com.google.android.gms:play-services-maps:10.2.0'使用本compile com.google.android.gms:play-services-maps:10.0.1'