无法解决firebase依赖关系[重复]

问题描述 投票:0回答:2

我的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'

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

android firebase android-studio firebase-authentication
2个回答
2
投票

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

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

并仅添加此项

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

1
投票

应该:

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

在项目级别构建gradle文件:

allprojects {
  repositories {
    google() //add this line
    jcenter()
    // ...
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.