实现'com.android.support:appcompat-v7:28.0.0'-无法解决:firebase-core / auth-15.0.0

时间:2018-12-13 04:02:03

标签: android firebase

在android studio中,添加Firebase身份验证后,出现此错误Failed to resolve: firebase-core-15.0.0Failed to resolve: firebase-auth-15.0.0,我将v7:28.0.0更改为v7:28.+,但出现了同样的错误。我添加了Maven

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

,但出现相同的错误。

完整的build.gradle代码:

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

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.thisuri.blogzone"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    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.1:15.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'


}

解决方案是什么?

1 个答案:

答案 0 :(得分:0)

更改此:

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

对此:

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

声明依赖项时,您需要编写groupId,artifactId和版本号。

也请检查以下内容:

https://firebase.google.com/support/release-notes/android