无法调用RNFirebaseFirestore.collectionOnSnapshot null失败

无法调用RNFirebaseFirestore.collectionOnSnapshot null失败,firebase,react-native,google-cloud-firestore,react-android,Firebase,React Native,Google Cloud Firestore,React Android,我有以下配置 app/build.gradle implementation project(':react-native-firebase') implementation "com.google.firebase:firebase-auth:11.+" implementation "com.google.firebase:firebase-core:11.+" implementation "com.google.firebase:firebase-firesto

我有以下配置 app/build.gradle

 implementation project(':react-native-firebase')
    implementation "com.google.firebase:firebase-auth:11.+"
    implementation "com.google.firebase:firebase-core:11.+"
    implementation "com.google.firebase:firebase-firestore:11.+"
    implementation "com.google.firebase:firebase-database:11.+"
    // implementation "com.google.firebase:firebase-auth:11.+"
    implementation(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation 'com.google.android.gms:play-services-base:11.+'
    implementation 'com.google.android.gms:play-services-maps:11.+'
    implementation 'com.google.android.gms:play-services-location:11.8.0'
    implementation project(':react-native-geolocation-service')
    implementation project(':react-native-background-timer')
    implementation project(':react-native-mauron85-background-geolocation')
    implementation project(':react-native-contacts')
    implementation project(':react-native-gesture-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.1'
Package.json

"react": "16.6.3",
    "react-native": "0.58.6",
    "react-native-background-timer": "^2.1.1",
    "react-native-contacts": "^3.1.4",
    "react-native-firebase": "^5.2.3",
    "react-native-geolocation-service": "^2.0.0",
    "react-native-gesture-handler": "^1.1.0",
    "react-native-maps": "^0.23.0",
    "react-native-mauron85-background-geolocation": "^0.5.0",
    "react-native-permissions": "^1.1.1",
    "react-navigation": "^3.3.2"
Android/gradle

 implementation project(':react-native-firebase')
    implementation "com.google.firebase:firebase-auth:11.+"
    implementation "com.google.firebase:firebase-core:11.+"
    implementation "com.google.firebase:firebase-firestore:11.+"
    implementation "com.google.firebase:firebase-database:11.+"
    // implementation "com.google.firebase:firebase-auth:11.+"
    implementation(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation 'com.google.android.gms:play-services-base:11.+'
    implementation 'com.google.android.gms:play-services-maps:11.+'
    implementation 'com.google.android.gms:play-services-location:11.8.0'
    implementation project(':react-native-geolocation-service')
    implementation project(':react-native-background-timer')
    implementation project(':react-native-mauron85-background-geolocation')
    implementation project(':react-native-contacts')
    implementation project(':react-native-gesture-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.1'
当我试图跟随

在此处获取错误

this.unsubscribe = firebase.firestore().collection('locations').onSnapshot(this.getCollectionData)

应用程序崩溃

请帮忙


谢谢,我也有同样的错误。请创建名为“locations”的集合并添加虚拟文档。然后再试。

我也有同样的错误。请创建名为“locations”的集合并添加虚拟文档。然后再试。

您对firebase集成的定义是什么?rnfirebase Library我可以在firebase中添加数据,但在使用onSnapshot时出现抛出错误您是否遵循了此文档?是,此处出现错误。unsubscribe=firebase.firestore().collection('locations')。onSnapshot(this.getCollectionDataFirebase集成指的是什么?.rnfirebase库我可以在firebase中添加数据,但在使用onSnapshot时出现抛出错误您是否遵循了此文档?.unsubscribe=firebase.firestore().collection('locations').onSnapshot(this.getCollectionData