0

I'm implementing react-native-firebase 5.2.0 with react-native 0.57.0.

I've made all the configuration asked in the documentation, but, when I'm going to perform a query with firebase firestore, the app crashes!

While debugging I can see that the query is indeed executed successfully, but not whithout closing the app.

These is the code I'm executing:

componentDidMount() {
firebase.firestore().collection('users').get().then((snap) => {
  console.log(snap);
});}

Just to be clear, no error is trow while executing, just the app close.

That happens only when I use some method with firestore, like .get(), .add(), .update(), etc...

Anyone can help me with that?

2 Answers2

0

You better look directly at your USB-Device via adb logcat for errors, because they are more detailed then the App-Logs (Red-Screens).

Because logcat allways log errors even if the App fully crash, and don't was able to show you an redscreen.

Android-Studio can be used as nice GUI for logcat, even like some other Applications out there too (https://github.com/search?q=logcat)

How to start Logcat in Android-Studio

If you use android-studio, make sure to use your /android-Directory inside your Projectfolder as Project-Root (don't use your react-native-project-root !). Then open Logcat with pressing SHIFT thee times and typinng Logcat

suther
  • 12,600
  • 4
  • 62
  • 99
0

On Android

Adding this to my android/app/build.gradle resolved this issue for me:

dependencies {
  // Your over dependencies
  // ...
  implementation "io.grpc:grpc-okhttp:1.32.2"
  // ...
}

I could see the error when launching the app with Android Studio and got this:

E/androidruntime: fatal exception: grpc-okhttp-0

Here's where I got this from.