错误:(32、13)无法解决:com.google.firebase:firebase-firestore:10.0.1

时间:2018-07-10 17:54:26

标签: android firebase android-studio google-cloud-firestore android-library

我想在应用程序中添加Firestore,我的android studio版本是2.3.2,但是我在Firebase助手中看不到firestore选项,而且当我为Firestore添加librar时:-

compile 'com.google.firebase:firebase-firestore:10.0.1'

它向我显示此错误:-

Error:(32, 13) Failed to resolve: com.google.firebase:firebase-firestore:10.0.1

请帮助我解决这个问题!

这是我的应用程序级别的构建Gradel文件:-

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "in.anew.trysafeblog"
        minSdkVersion 21
        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 {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
    compile 'com.google.firebase:firebase-storage:10.0.1'
    compile 'com.google.firebase:firebase-firestore:10.0.1'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

请帮帮我!!! 建立gradle文件:-

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'

        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.1'
        //classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

2 个答案:

答案 0 :(得分:1)

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

dplyr::bind_rows(df, .id = "Method")

compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-firestore:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'

也请不要忘记添加:

implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'

到您的build.gradle文件。请参阅here更多信息。

答案 1 :(得分:0)

使用

在您的 app / build.gradle

| ID | SOMENUMT | SUM |
-----------------------
|  1 |       10 |  10 |
|  2 |       12 |  22 |
|  3 |        3 |  25 |
|  4 |        7 |  32 |
|  5 |        8 |  40 |
|  6 |       10 |  50 |

在您的 project / build.gradle

compile 'com.google.firebase:firebase-firestore:17.0.2'
compile 'com.google.firebase:firebase-storage:16.0.1'
compile 'com.google.firebase:firebase-auth:16.0.2'