Gradle未能解决:com.firebaseui:firebase-ui-auth:3.2.1

时间:2018-01-24 09:55:57

标签: android firebase gradle firebase-authentication firebaseui

Gradle同步失败,因为com.firebaseui:firebase-ui-auth:3.2.1未解决

我正在使用Firebase和Google Play服务的最新依赖项。尝试从Firebase控制台启用signIn选项。另外,在app目录下添加了google-services.json。仍然,gradle sync上的错误相同

以下是应用和项目级别的gradle文件:

应用程序/的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId 'com.google.firebase.example.fireeats'
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName '1.0'

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

dependencies {
    // Firestore
    compile 'com.google.firebase:firebase-firestore:11.8.0'

    // Other Firebase/Play services deps
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.android.gms:play-services-auth:11.8.0'

    // FirebaseUI (for authentication)
    compile 'com.firebaseui:firebase-ui-auth:3.2.1'

    // ButterKnife (for sample code brevity)
    compile 'com.jakewharton:butterknife:8.7.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'

    // Support Libs
    compile 'com.android.support:appcompat-v7:27.0.1'
    compile 'com.android.support:animated-vector-drawable:27.0.1'
    compile 'com.android.support:cardview-v7:27.0.1'
    compile 'com.android.support:customtabs:27.0.1'
    compile 'com.android.support:design:27.0.1'
    compile 'com.android.support:recyclerview-v7:27.0.1'

    // Android architecture components
    compile 'android.arch.lifecycle:runtime:1.0.0-alpha9'
    compile 'android.arch.lifecycle:extensions:1.0.0-alpha9'
    annotationProcessor 'android.arch.lifecycle:compiler:1.0.0-alpha9'

    // Third-party libraries
    compile 'me.zhanghai.android.materialratingbar:library:1.0.2'
    compile 'com.github.bumptech.glide:glide:3.7.0'
}

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

项目/的build.gradle

//顶级构建文件,您可以在其中添加所有子项目/模块共有的配置选项。

buildscript {

    repositories {
        mavenCentral()
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

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

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

修改:将FirebaseUI版本从3.2.1更改为3.1.3。这是FirebaseUI的github页面 - https://github.com/firebase/FirebaseUI-Android,其中列出了针对Firebase / Play服务版本的FirebaseUI版本。虽然它将FirebaseUI版本3.2.1映射到Firebase / Play Services版本11.8.0,但它对我不起作用。

2 个答案:

答案 0 :(得分:2)

在你的gradle中

添加此依赖项

 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.firebaseui:firebase-ui-auth:3.1.3'

答案 1 :(得分:0)

对我来说,当我将所有google-play-services和firebase服务更改为11.0.8时。它奏效了。

但我不知道确切的问题在哪里。

compile 'com.google.firebase:firebase-crash:11.0.8'
compile 'com.google.firebase:firebase-core:11.0.8'
compile 'com.google.android.gms:play-services-gcm:11.0.8'
compile 'com.google.android.gms:play-services-location:11.0.8'