invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.71k stars 2.22k forks source link

[Android] firebase.crashlytics().crash() #1636

Closed dantn93 closed 6 years ago

dantn93 commented 6 years ago

Issue

I integrate the crashlytics and test (firebase.crashlytics().crash()) on android emulator, but it raises this bug "length=2; index=10" screen shot 2018-10-25 at 6 55 41 pm

I found this post https://code.luasoftware.com/tutorials/android/setup-firebase-crashlytics-on-android-for-crash-reporting/#enable-crashlytics-in-firebase-console

It show that correctly, then I open console firebase but I don't see any crashes.

screen shot 2018-10-25 at 10 03 01 pm

This is my craslytics page

screen shot 2018-10-25 at 10 00 36 pm

How can I fix it?


Project Files

Titozzz commented 6 years ago

Hello, the purpose of the function crash that you are calling is literally to ... crash() so that you get a real report on crashlytics.. 🚀 . The report will probably take some time to appear

dantn93 commented 6 years ago

@Titozzz When I test on ios simulator. It appears immediately. Do you know how long it will appear? I mean sometimes ... 1 hours or two or more than

dantn93 commented 6 years ago

@Titozzz Please reopen this topic. I think this service having problems. I have waited for more than 12 hours, but I don't receive any report in console firebase. Can you give me a "crashlytics service" demo? Thanks

navata commented 6 years ago

I have this issues. I think we should update this library.

jgitt commented 6 years ago

I'm only testing on Android and it didn't work when running via dev on emulator or device. I waited over 12 hours and nothing.

It did work, however, when building a released version. That said, I've noticed that crashes don't show up consistently or instantly. I dunno, will continue testing but it looks like it works at least.

GIRIRAJNAGAR768 commented 4 years ago

use following dependencies for android: Paste it into build.gradle:app

implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') { transitive = true }

upgrade it from 2.9.5 to 2.9.6

it works for me. Thanks

mikehardy commented 4 years ago

No, don't use those. They are out of date. 2.10.1 is current https://firebase.google.com/support/release-notes/android

thanhluantl2304 commented 4 years ago

Dear mr @mikehardy I've tried test crash in debug mode. But it still not showing any issues in Firebase Console but only Crash-free statistics changed. Can you help me about that?

mikehardy commented 4 years ago

@thanhluantl2304 there are a lot of docs you need to read I think, especially the ones upstream on the google firebase site. Crashes won't report by default in debug mode. And you may not have uploaded de-obfuscation files. You have to relaunch the app to send the crash, etc etc.

thanhluantl2304 commented 4 years ago

Thanks Mr @mikehardy i ran it as released app then it worked. But I want to ask you 1 more question. The report shown not clear issue's info. I want something like react native file name, error line number in react native file but report shown only info about native code (index.bundle). Can you explain about that? If could not, can you introduce me another library to get linenumber, filename when catch exception? Thank you very much!

mikehardy commented 4 years ago

@thanhluantl2304 so you need to maintain sourcemaps from your build process. Crashlytics has no map that goes back from the minimized/bundled javascript to the separate javascript files, back to maybe the typescript or whatever right? So if you need the original line numbers you must maintain sourcemaps and trace back. I'm unaware of off the shelf scripts that do that but they probably exist.

thanhluantl2304 commented 4 years ago

Ok, I'm going to try sentry for that purpose! Thanks you very much for the help!