2017-06-06 30 views
0

錯誤:任務':app:processDebugGoogleServices'的執行失敗。 請修正版本衝突,或者通過更新版本谷歌服務的插件(有關最新版本信息,請https://bintray.com/android/android-tools/com.google.gms.google-services/)或更新com.google.android.gms的版本10.2.6。錯誤「請通過更新Google服務插件的版本來修復版本衝突」

根據我的build.gradle版本都還好

build.gradle(module:app)

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion '25.0.1' 
    defaultConfig { 
     applicationId "com.example.deepdepindersingh.mutual" 
     minSdkVersion 19 
     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' 
     } 
    } 


    buildTypes.each { 
     it.buildConfigField 'String', 'UNIQUE_FIREBASE_ROOT_URL', UniqueFirebaseRootUrl 
    } 


    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/NOTICE' 
    } 

} 

configurations.all { 
    resolutionStrategy { 
     force 'com.google.code.findbugs:jsr305:1.3.9' 
    } 
} 
configurations { 
    compile.exclude group: "org.apache.httpcomponents", module: "httpclient" 
} 

dependencies { 

    compile 'com.google.firebase:firebase-core:10.2.6' 
    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:24.2.1' 


    //compile 'com.google.android.gms:play-services:10.2.6' 
    compile 'com.firebase:firebase-client-android:2.5.2' 
    compile 'com.google.firebase:firebase-auth:9.6.1' 
    compile 'com.google.firebase:firebase-core:9.6.1' 
    compile 'com.firebaseui:firebase-ui:0.5.3' 
    //compile 'com.google.android.gms:play-services-maps:10.2.6' 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:cardview-v7:25.3.1' 

    /* For Google Play Services */ 
    //compile 'com.google.gms:google-services:3.1.0' 
    //compile 'com.google.android.gms:play-services-safetynet:10.2.6' 
    // compile 'com.google.android.gms:play-services-auth:10.2.6' 
    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.2' 
     classpath 'com.google.gms:google-services:3.1.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 
} 

回答

1

您正在使用10.2.6火力點在你的依賴 編譯 'com.google.firebase:火力核心:10.2.6'

和9.6.1對於其餘 編譯 'com.google.firebase:火力-AUTH:9.6.1' 編譯 'com.google.firebase:火力核心:9.6.1'

你必須始終使用谷歌相關的東西相同的版本。 更改Firebase身份驗證和核心也到10.2.6

+0

謝謝你的兄弟....但現在第二個問題發生... – user3701411

+0

謝謝你的兄弟....但現在第二個問題發生... – user3701411

+0

這種支持庫不應該使用低於targetSdkVersion(26)的較低版本(25)...(Ctrl + F1) 存在某些不兼容或可能導致錯誤的庫或工具和庫的組合。其中一種不兼容性是使用不是最新版本的Android支持庫(或特別是低於targetSdkVersion的版本)進行編譯。 – user3701411

相關問題