执行失败的任务':应用程序:processMinSdkIcsDebugGoogleServices

问题描述:

因此,我下载了firebase快速入门,我正在尝试学习如何使用android studio和firebase构建android应用程序,但我无法获得此应用程序编译。每当我尝试运行它,我得到的错误...执行失败的任务':应用程序:processMinSdkIcsDebugGoogleServices

Error:Execution failed for task ':app:processMinSdkIcsDebugGoogleServices'. 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 11.2.0.

在我的build.gradle它具有com.google.android.gms:发挥服务-AUTH:11.2.0,并在主build.gradle文件是com.google.gms:google-services:3.1.0,它们都是它所要求的正确版本,所以它对我来说没有任何意义,因为它告诉我这就是它所需要的,就是这样。这里是我的模块文件的build.gradle:应用

apply plugin: 'com.android.application' 
check.dependsOn 'assembleMinSdkJellybeanDebugAndroidTest', 'assembleMinSdkIcsDebugAndroidTest' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "25.0.3" 
    flavorDimensions "minSdkVersion" 

    defaultConfig { 
     applicationId "com.google.firebase.quickstart.auth" 
     minSdkVersion 14 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' 
    } 

    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    lintOptions { 
     abortOnError false 
    } 

    productFlavors { 

     // Build variant with minSdk 16 to include Facebook and FirebaseUI libraries. 
     minSdkJellybean { 
      dimension "minSdkVersion" 
      minSdkVersion 16 
     } 

     // Build variant with minSdk 14, excludes Facebook and FirebaseUI libraries. 
     minSdkIcs { 
      dimension "minSdkVersion" 
      minSdkVersion 14 
     } 

    } 
} 

configurations.all { 
    resolutionStrategy.force 'com.android.support:support-annotations:26.0.0' 
} 

dependencies { 

    // Firebase Authentication 

    // Google Sign In SDK (only required for Google Sign In) 

    // Firebase UI 
    // Used in FirebaseUIActivity. The FirebaseUI-Android library has a minSdk level of 16 
    // so this library is only included in the minSdkJellybean variant. 

    // Facebook Android SDK (only required for Facebook Login) 
    // Used in FacebookLoginActivity. This is only compiled into the minSdkJellybean variant of this 
    // app. You can build a 'minSdkGingerbread' variant to test on devices with 9 <= SDK <= 15. 

    // Twitter Android SDK (only required for Twitter Login) 
    compile('com.twitter.sdk.android:twitter-core:[email protected]') { 
     transitive = true 
    } 
    compile('com.twitter.sdk.android:twitter:[email protected]') { 
     transitive = true 
    } 

    compile 'com.android.support:appcompat-v7:26.0.0' 
    compile 'com.android.support:animated-vector-drawable:26.0.0' 
    compile 'com.android.support:cardview-v7:26.0.0' 
    compile 'com.android.support:design:26.0.0' 
    compile 'com.google.firebase:firebase-auth:11.2.0' 
    compile 'com.google.android.gms:play-services-auth:11.2.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.firebase:firebase-storage:10.0.1' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
    androidTestCompile 'com.android.support.test:runner:0.5' 
    minSdkJellybeanCompile 'com.firebaseui:firebase-ui-auth:1.2.0' 
    minSdkJellybeanCompile 'com.facebook.android:facebook-android-sdk:4.9.0' 
    minSdkJellybeanCompile 'com.android.support:customtabs:26.0.0' 
} 

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

这里是项目的文件的build.gradle:AUTH

buildscript { 
    repositories { 
     jcenter() 
     mavenLocal() 
     maven { url 'https://maven.google.com' } 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     classpath 'com.google.gms:google-services:3.1.0' 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     mavenLocal() 
     maven { url 'https://maven.google.com' } 
     maven { url 'https://maven.fabric.io/public' } 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

我不明白,这两者的东西它说,这需求是它需要的版本,但它仍然抱怨并且不会编译。请帮忙,我感觉很糟糕,我甚至无法使用预制快速入门程序进行编译,这是由Google制作的。谢谢。

您使用的是与Google服务版本11.2.0不同的Firebase插件版本10.0.1。您应该更新您的火力地堡插件或改变所有其它google-sdk versions from 11.2.0 to 10.0.1

你可以改变依赖于这样的:

compile 'com.android.support:appcompat-v7:26.0.0' 
compile 'com.android.support:animated-vector-drawable:26.0.0' 
compile 'com.android.support:cardview-v7:26.0.0' 
compile 'com.android.support:design:26.0.0' 
compile 'com.google.firebase:firebase-auth:10.0.1' 
compile 'com.google.android.gms:play-services-auth:10.0.1' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.google.firebase:firebase-storage:10.0.1' 
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
androidTestCompile 'com.android.support.test:runner:0.5' 
minSdkJellybeanCompile 'com.firebaseui:firebase-ui-auth:1.2.0' 
minSdkJellybeanCompile 'com.facebook.android:facebook-android-sdk:4.9.0' 
minSdkJellybeanCompile 'com.android.support:customtabs:26.0.0' 

或本:

compile 'com.android.support:appcompat-v7:26.0.0' 
compile 'com.android.support:animated-vector-drawable:26.0.0' 
compile 'com.android.support:cardview-v7:26.0.0' 
compile 'com.android.support:design:26.0.0' 
compile 'com.google.firebase:firebase-auth:11.2.0' 
compile 'com.google.android.gms:play-services-auth:11.2.0' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.google.firebase:firebase-storage:11.2.0' 
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
androidTestCompile 'com.android.support.test:runner:0.5' 
minSdkJellybeanCompile 'com.firebaseui:firebase-ui-auth:1.2.0' 
minSdkJellybeanCompile 'com.facebook.android:facebook-android-sdk:4.9.0' 
minSdkJellybeanCompile 'com.android.support:customtabs:26.0.0' 
+0

非常感谢你,我没看到那个存储在那里。老实说,我甚至都没有想到要找它。它说我需要将com.google.android.gms更新到11.2.0,我不知道你是如何设法意识到这一点的。非常感谢。 –

+0

很高兴能有所帮助 –