所以,我下载了firebase quickstarters,我正在尝试学习如何使用android studio和firebase构建android应用程序,但是我无法让这个应用程序进行编译。每当我尝试运行它时,我都会收到错误...
错误:任务执行失败 ':应用程序:processMinSdkIcsDebugGoogleServices'。请修复版本 通过更新google-services插件的版本进行冲突 (有关最新版本的信息,请访问: https://bintray.com/android/android-tools/com.google.gms.google-services/) 或将com.google.android.gms的版本更新为11.2.0。
在我的build.gradle中,它有com.google.android.gms:play-services-auth:11.2.0,在main build.gradle文件中有com.google.gms:google-services:3.1 .0,这两个版本都是它所要求的正确版本,所以对我来说为什么它告诉我它需要什么,这就是它所拥有的东西是没有意义的。这是我的Module:app
的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:1.6.6@aar') {
transitive = true
}
compile('com.twitter.sdk.android:twitter:1.13.1@aar') {
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'
这是Project:auth
的build.gradle文件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
}
我不明白,它说它需要的东西都是它需要的版本,但它仍然抱怨并且不会编译。请帮助,我觉得很糟糕,我甚至无法得到一个由谷歌制作的预制快速入门编译。谢谢。
答案 0 :(得分:1)
您使用的Firebase插件版本10.0.1
与Google服务版本11.2.0
不同。您应该更新Firebase插件或更改所有其他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'