-
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
[🐛] Crashlytics log is not working for Android #4772
Comments
Oh that's unexpected. Can you reach in to node_modules javascript add console.logs and android add System.err.println's to trace that through prior to API calls etc? I thought we even had testing around that area but now of course I'm not sure |
Could you please clarify where I exactly should insert logging? Files, lines, etc. |
Sorry, the idea is that you'll have to roll your sleeves up and determine those things for yourself. The method call names themselves are searchable and will give you the entry point(s) (e.g. |
And I don't mind rolling my sleeves up but I am not sure I understand what exactly should I log. |
We are looking for basic proof that the APIs are even exercised, as a fundamental step, and that they have the parameters we expect, and return success. This will show:
It's a bit shocking how frequently 1 above fails even. So it's worth verifying. 2 above will help show us where in the stack the problem is (is it react-native-firebase? is it firebase-android-sdk? Something else?) which will direct further effort |
|
Screenshots are unfortunately difficult ways to communicate via github, it is pretty disjointed following those little captures through, I was hoping (as mentioned) for console / System.err statements so we could throw text around. If I'm following the the screen caps correctly, do you see anything that indicates we are not calling the firebase-android-sdk API guidance? In other words, questions 1 and 2 above both seem to be answered in the affirmative, which indicates there is either something in the test setup (using real device? release mode just to make sure?) or firebase-android-sdk code going wrong, but that there may not be a problem in this code. I wonder if you can reproduce with a pure firebase-android-sdk quickstart https://github.com/firebase/quickstart-android/tree/master/crash |
Hello @mikehardy
But if I try to log in addition to that native crash from RN then these logs do not appear in the console, just the native ones. And in case if I generate a crash on JS then no messages appear at all. |
So, if firebase-android-sdk is working and react-native-firebase is just a thin wrapper around it, can you put logging around the API calls we make to the sdk to see where expectations aren't meeting reality? This is a very simple area of the code if I recall correctly, might be just a couple minutes more to find the issue |
Isn't it what I provided with screenshots? And what did you mean by "calls"? Because the only call I do is
|
Yes, by "calls" I mean in our module ("my" module? It's open source! It's your module! It's our module!) react-native-firebase to firebase-android-sdk - also open source! https://github.com/firebase/firebase-android-sdk/tree/master/firebase-crashlytics) Interesting that it appears the underlying firebase-android-sdk API is called correctly, perhaps there is some asynchronicity not being respected? Like adding an 1-second sleep just as a test to make sure the log message is digested before crashing could help, but the log timestamps indicate you waited almost 1.5 seconds. I can't explain these results, sorry |
Yes, you are right, it is open source. Sorry if it sounded rude from me. I meant the part which you probably know better than me. |
It wasn't rude, you have been quite helpful working to track this down, I just wanted to maintain perspective, especially because I don't have time personally to work on this issue unfortunately though I will do my very best to share with you any thing I know in the area if I know something. Unfortunately I don't have special knowledge here, for me this is still in the standard "trace things / log parameters + results" phase and I'm stumped |
Finally, I found out the reason of the issue. The thing is react-native-crashlytics module is generating additional non-fatal issue |
Hmm, that's a highly desired feature - that javascript crashes are sent to crashlytics, it's a vital part of crash logging for a react-native (i.e., javascript) app. I would advise a documentation update around react-native-crashlytics instead, somewhere in the usage area - where ever it says to view the crashes on the console - that mentions in bold that javascript crashes are logged as "non-fatal" since they don't crash the app, so for react-native-firebase you should not apply the fatal filter when viewing crashes. That fits the ecosystem here (react-native vs native) better I think? If you agree there's an edit button on the top of every docs page |
Great digging by the way, that is subtle! |
But as we can see from my investigation it's working without additional crashes generation from react-native-crashlytics side. React Native itself passes JS exceptions to native side where native crashlytics module does all work. It detects that exception and collect all logs. I think such react-native-crashlytics module behavior should be optional at least. |
This is vague, but I believe there was some special processing that react-native-firebase did with regard to javascript frames to bend them into the stack frame format that firebase crashlytics wants, so I believe this is desired still. If you want to make it optional, PRs are happily merged - in the case of feature toggles, especially if they don't change default behavior. There are a few PRs merged in last couple of weeks that add toggles for base sdk features like "auto collection of performance module data at startup" that can serve as a pattern |
I spent the last 2 or 3 hours digging into |
@gustavopch oh no - I hate hearing people losing time like that. I have personally been bitten by the fatals / non-fatal thing. I'm mainly replying to say that you are going to love the new firebase crashlytics feature they're implementing for us that allows for dynamic languages that have crashes to be logged as fatal - if you'd had this problem in just a couple days it will probably be merged + released #5047 |
Issue
firebase.crashlytics().log() is not working on Android. To be sure I created a new react-native project from scratch with
react-native init
and just@react-native-firebase/app
and@react-native-firebase/crashlytics
dependencies added. After initiating a crash I can see the report on the firebase console but there are no logs under the appropriate tab that I passed before the crash withfirebase.crashlytics().log()
method. BTW I tried withrecordError()
too but still nothing. IOS logs are working at the same time.Project Files
Javascript
Click To Expand
package.json
:App.js:
iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
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:10.4.0
Firebase
module(s) you're using that has the issue:"@react-native-firebase/crashlytics": "10.4.1"
TypeScript
?N
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: