React-native-firebase: Getting could not invode RNFirebaseFirestore.documentSet null No virtual method Set

Created on 28 Jan 2019  路  4Comments  路  Source: invertase/react-native-firebase


Issue

Please find the attached screenshot for exact error. I'm getting this error when I'm trying to set the data to firestore. Following is the code

import firebase from 'react-native-firebase';

export function updateMemberDetails() {
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);
});
}

I'm calling updateMemberDetails() method from different component. I was able to debug and see that the code is entering the method after that I'm getting could not invode RNFirebaseFirestore.documentSet null No virtual method Set error. It's not going to catch block also




Project Files






iOS

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A

Android

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment

  • Platform that you're experiencing the issue on:

    • [ ] iOS

    • [x] Android

    • [ ] iOS but have not tested behavior on Android

    • [ ] Android but have not tested behavior on iOS

    • [ ] Both

  • If known, the version of the platform are you experiencing the issue on:

    • ADD_SOMETHING_HERE e.g. iOS 10 or Android API 28

  • Operating System:

    • [x] MacOS, version: N/A

    • [ ] Windows, version: N/A

    • [ ] Other, please specify: N/A

  • Build Tools:

    • Android Studio 3.2.1 e.g. Xcode 10, Android Studio 3.2

  • React Native version:

    • 0.57.7

  • React Native Firebase library version:

    • React Native Firebase version 5.2.1

  • Firebase module(s) you're using that has the issue:

    • [ ] N/A

    • [ ] Authentication

    • [ ] Analytics

    • [x] Cloud Firestore

    • [ ] Cloud Messaging (FCM)

    • [ ] Crashlytics

    • [ ] Dynamic Links

    • [ ] Functions Callable

    • [ ] Invites

    • [ ] Instance ID

    • [ ] Notifications

    • [ ] Performance Monitoring

    • [ ] Realtime Database

    • [ ] Remote Config

    • [ ] Storage

  • Are you using TypeScript?

    • [X] No

    • [ ] Yes, version: N/A

  • Are you using Expo, e.g. ExpoKit?

    • [x] No

    • [ ] Yes, I've _not_ ejected

    • [ ] Yes, but I have ejected to ExpoKit

    • [ ] Yes, but I have ejected to vanilla React Native

    • Expo version: N/A




Think react-native-firebase is great? Please consider supporting the project with any of the below:

Most helpful comment

@thirappusuresh please can fill out the full issue template, we can't guess what android versions of the SDKs you're running. 馃檲

This error occurs though when you're using an incorrect version of the Android Firestore SDK. You should be using 17.1.5 as the docs indicate and as @Josh-Uvi pointed out above.

All 4 comments

Please find the attachment of error
6002168434851431314

I have the same problem on android but it works fine on iOS. Any help would be greatly appreciated. Thanks in advance

I have the same problem on android but it works fine on iOS. Any help would be greatly appreciated. Thanks in advance

A solution I found: was to revert back to firestore version 17.1.5
dependencies {
// ...
implementation "com.google.firebase:firebase-firestore:17.1.5"
}

@thirappusuresh please can fill out the full issue template, we can't guess what android versions of the SDKs you're running. 馃檲

This error occurs though when you're using an incorrect version of the Android Firestore SDK. You should be using 17.1.5 as the docs indicate and as @Josh-Uvi pointed out above.

Was this page helpful?
0 / 5 - 0 ratings