未能解析firestore android studio

ni65a41a  于 2021-07-09  发布在  Java
关注(0)|答案(2)|浏览(257)

我遵循了firestore的教程,但是发生了这个错误,我的项目级gradle文件中包含了所有必要的内容,我检查了与我类似的其他问题,我的问题与我的不同。你能帮忙吗?
错误:未能解析:com.google。firebase:firebase-firestore:16.0.1
应用等级等级:

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

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.blindnews.kimh2.blindnews"
        minSdkVersion 15
        targetSdkVersion 27
        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'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
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'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-firestore:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'

}

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

xghobddn1#

要解决此问题,请更改以下代码行:

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-firestore:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'

implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-firestore:18.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'

在你的最高水平 build.gradle 文件请确保有最新版本的谷歌服务插件:

classpath 'com.google.gms:google-services:4.2.0'
0ve6wy6x

0ve6wy6x2#

首先,检查最新的依赖版本。可能你把这行加了两次这就是为什么gradle不能解决这个问题:

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

并将类路径添加到项目级gradle文件中

classpath 'com.google.gms:google-services:4.2.0'

相关问题