首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法调用RNFirebaseFirestore.collectionOnSnapshot空值失败

无法调用RNFirebaseFirestore.collectionOnSnapshot空值失败
EN

Stack Overflow用户
提问于 2019-03-25 11:23:53
回答 1查看 317关注 0票数 1

我有下面的配置app/build.gradle

代码语言:javascript
复制
 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

Package.json

代码语言:javascript
复制
"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

代码语言:javascript
复制
classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.1'

当我试图跟随

https://firebase.google.com/docs/android/setup#available-libraries

在此获取错误

代码语言:javascript
复制
this.unsubscribe = firebase.firestore().collection('locations').onSnapshot(this.getCollectionData)

应用程序崩溃

请帮帮忙

谢谢

EN

回答 1

Stack Overflow用户

发布于 2019-08-21 13:58:37

我也有同样的错误。请使用名称“locations”创建集合,并添加一个虚拟文档。那就试试吧。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55336722

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档