请查看附带的屏幕截图,了解确切错误。当我尝试将数据设置为firestore时,我收到此错误。以下是代码
import firebase from 'react-native-firebase';
export function initializeFirestore() {
firebase
.firestore()
.collection('communities')
.doc('communityname')
.collection('members')
.doc('memberid')
.set({ field1: 'value1' })
.then(function(docRef) {})
.catch(function(error) {
console.error('Error updating userChannel : ', error);
});
}
我不确定你是否得到了你的答案但是,我唯一看到的解决方法是将firebase-firestore降级到应用级别的17.1.5版本Build.gradle文件添加implementation "com.google.firebase:firebase-firestore:17.1.5"
我从here得到了答案