React-native-firebase: [Android] firebase.crashlytics().crash()

Created on 25 Oct 2018  路  12Comments  路  Source: invertase/react-native-firebase


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



  • Android: android/build.gradle contents.
buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
   }
  • Android: android/app/build.gradle contents.
implementation "com.google.firebase:firebase-core:16.0.4"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
        transitive = true
    }

Environment

  • React Native version:
    React Native 0.55.4
  • React Native Firebase library version:
    "react-native-firebase": "5.0.0"
  • Firebase module(s) you're using that has the issue:

    • [x] Crashlytics

Most helpful comment

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

All 12 comments

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

@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

@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

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

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.

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

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

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?

@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.

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!

@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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

romreed picture romreed  路  3Comments

callmejm picture callmejm  路  3Comments

escobar5 picture escobar5  路  3Comments

mahyarr picture mahyarr  路  3Comments

alizahid picture alizahid  路  3Comments