首页 > 解决方案 > 无法解决 Firebase 依赖项

问题描述

我的build.gradle文件如下:

apply plugin: 'com.android.application'

android {

    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.my.prohead"
        minSdkVersion 24
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    //testImplementation 'junit:junit:4.12'
    //androidTestImplementation 'com.android.support.test:runner:1.0.2'
    //androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    //implementation 'com.google.firebase:firebase-core:16.0.6'

    //implementation 'com.google.firebase:firebase-auth:11.0.4'
    // implementation 'com.google.firebase:firebase-database:16.0.5'

    //implementation 'com.google.firebase:firebase-auth:16.1.0'


    implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'

}

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

但是它并没有被编译,虽然如果我尝试更改实现它说依赖关系没有设置,但已经设置了依赖关系!
任何帮助将不胜感激!

标签: androidfirebaseandroid-studiofirebase-authentication

解决方案


从您的应用级别build.gradle文件中删除它:

implementation 'com.google.firebase:firebase-auth:16.1.0:15.0.0'

并只添加这个

implementation 'com.google.firebase:firebase-auth:16.1.0'

推荐阅读