-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔥[v6][Firestore] Error trying to add a document to a collection: "this._firestore.native.documentSet is not a function" #2773
Comments
I believe .set requires a doc id to be passed to doc() otherwise you use .add. |
You can create a document with no params to assign an auto ID. @mcgomez I've just tried/tested this code locally and it's working as expected. That error suggests it hasn't loaded in the native code, therefore the native method hasn't been exported. Have you installed correctly? Also do any other Firestore related methods work? |
@Ehesp I believe I've installed correctly. I'm able to create a collection reference and get the path from it:
gives me: |
That all happens locally within the JS - have you tried to add data any other way? For example: firestore().collection('foo').add({ foo: 'bar' }) |
@Ehesp looks like I get the same error when I try to do: await collectionRef.add({ foo: "bar" })
I have since followed the manual installation instructions, and everything works as expected! Thanks for the help 👍 |
Did you solve this issue? |
to get this working for android enable multidex - https://rnfirebase.io/enabling-multidex |
still problem |
@Sayyamabbasi786 not at all a problem actually, it's an issue closed in 2019 and we are about to welcome 2021. |
Issue
Added Firebase Firestore via:
yarn add @react-native-firebase/firestore
Import firestore:
Try to add a new document to a collection:
I get the following error:
Collection reference path:
gives me:
agency/RTE0ZMMxDL4SE5gEDKZO/client/466uQxL7940JvZotl8MI/data
Project Files
iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:android/app/build.gradle
:android/settings.gradle
:MainApplication.java
:AndroidManifest.xml
:Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:6.0.2
Firebase
module(s) you're using that has the issue:Firestore
TypeScript
?N
Think
react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: