Better exception call stack in Firebase Crashlytics for React Native app - firebase

I' receiving some crash reports in my Firebase Crashlytics dashboard. However, the report only shows native code call stacks, and JS stack is minimized and un-readable. For example:
Fatal Exception: com.facebook.react.common.JavascriptException: undefined is not a function (evaluating 'r[n]()'), stack:
<unknown>#284:210
value#36:1363
value#23:3582
<unknown>#23:1067
value#23:3009
value#23:1039
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
The only thing I can get from the above report is that the JS code is trying to invoke an undefined object, but it's hard to locate where exactly the issue is at.
Is it possible to submit a symbol file or mapping file of some kind, so that this report can be more useful to help me see which function is having the problem?
Thank you.

Related

Firebase: Function Triggers: A function used to work, now fails with "CANCELLED: The operation was cancelled."

I built this function months ago and has been working fine until two days ago, after updating Flutter (unrelated I presume). The function essentially reviews a users upload photo for inappropriate content before moving the documents for the public to see.
I can see the images and documents uploading correctly from app to Firestore. This then triggers the function which uses vision.ImageAnnotatorClient() to label the images ('#google-cloud/vision'). Almost immediately the function console throws this error:
onCreatePost:
Error: 1 CANCELLED: The operation was cancelled.
at Object.callErrorFromStatus (/srv/node_modules/#grpc/grpc-js/build/src/call.js:30:26)
at Http2CallStream.call.on (/srv/node_modules/#grpc/grpc-js/build/src/client.js:96:33)
at emitOne (events.js:121:20)
at Http2CallStream.emit (events.js:211:7)
at process.nextTick (/srv/node_modules/#grpc/grpc-js/build/src/call-stream.js:97:22)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
At what level is this cancellation occuring? I don't even know where to narrow down my search to.
How did this happen? Can I expect random functions to fail in the future?
Am I taking crazy pills? Feels like i'm going crazy looking for material on this.
Edit:
I have narrowed the error down to this line in my function:
var [dataTest] = await visionClient.annotateImage(request)
visionClient being an instance of vision.ImageAnnotatorClient();
vision coming from '#google-cloud/vision'
I also noticed that these errors started appearing after an unusual unique error:
onCreatePost
Error: function crashed out of request scope Function invocation was interrupted.
Solved the issue:
I had to go into my Flutter apps functions folder, where I hold my firebase cloud functions. I then had to update 'google-cloud/vision' using the following command:
npm install --save #google-cloud/vision
I deployed the new update to firebase and everything started working again... How am I supposed to catch updates on packages like this changing and breaking my code?

Flutter Firebase Crashlytics reports stack trace as Java class files and not as Dart files

I have integrated Flutter Crashlytics in our app, but it is reporting crashes stack trace in Java class files and not in Dart files. So it is difficult to infer what is the file and line number where this issue occurred in the flutter codebase.
Here is an example of one such crash report from Firebase Crashltytics of an Uncaught exception:
Non-fatal Exception: java.lang.Exception: NoSuchMethodError: The method 'markNeedsBuild' was called on null.
Receiver: null
Tried calling: markNeedsBuild()
at State.setState(State.java:1168)
at _ArgonButtonState.initState.<fn>(initState.java:107)
at AnimationLocalStatusListenersMixin.notifyStatusListeners(AnimationLocalStatusListenersMixin.java:193)
at AnimationController._checkStatusChanged(AnimationController.java:773)
at AnimationController._tick(AnimationController.java:789)
at Ticker._tick(Ticker.java:237)
at SchedulerBinding._invokeFrameCallback(SchedulerBinding.java:1102)
at SchedulerBinding.handleBeginFrame.<fn>(handleBeginFrame.java:1017)
at SchedulerBinding.handleBeginFrame(SchedulerBinding.java:1015)
at SchedulerBinding._handleBeginFrame(SchedulerBinding.java:949)
Here is how Crashlytics is initialized:
// Pass all uncaught errors from the framework to Crashlytics.
FlutterError.onError = Crashlytics.instance.recordFlutterError;
runZoned(() {
runApp(AppMain(homeWidget));
}, onError: Crashlytics.instance.recordError);
I am reporting caught exceptions as such:
Crashlytics.instance.recordError(error, stack);
How can I configure Crashlytics to report stack trace in dart? Does Crashlytics show erroneous file names and line numbers for Dart source code?
Todd from Crashlytics. This is a known behavior and we are looking into possible options moving forward. Kotlin users will see a similar behavior.
I would suggest to move on to Sentry.
I am doing it for my app now. And while just testing it, I can say that sentry is much better than Crashlytics!

React Native app crashes when login

I'm having troble with my app, this app is react native and everything is works well, but in production it's crashes on login. On Dev mode, on my phone it's okay, only on production crashes.
I tried some solutions that I found here in stackOverflow but none of them helped in fixing the bug.
The first error is a normal firebase connection and get uid for user. I can't fix this and it's a simple connection... help please!!
This is the error:
com.facebook.react.common.JavascriptException: null is not an object (evaluating 'l.currentUser.uid'), stack:
value#306:2672
onPress#306:6430
touchableHandlePress#174:1566
_performSideEffectsForTransition#167:8505
_receiveSignal#167:7292
touchableHandleResponderRelease#167:4757
g#41:296
invokeGuardedCallback#41:496
invokeGuardedCallbackAndCatchFirstError#41:611
A#41:2410
D#41:3172
U#41:2969
<unknown>#41:15497
batchedUpdates#41:72147
Ie#41:14848
ze#41:15343
receiveTouches#41:16180
value#18:3582
<unknown>#18:1067
value#18:3009
value#18:1039
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:207)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Thanks
Anderson - LógikaWeb
old version problem!
First the problem it's a empty variable. I changed a route and fix the code error in props.
I update my ambient and all works fine with 0.61 version.

Uncaught TypeError: n.Telemetry.PageViewPerformance.checkPageLoad is not a function

All our Microsoft Datazen servers are seeing an infine loop of client side javascript exceptions:
Uncaught TypeError: n.Telemetry.PageViewPerformance.checkPageLoad is not a function
since this script comes from http://az416426.vo.msecnd.net/scripts/a/ai.0.js the issue may be the App Insights cloud service.
As anyone experienced this?
Interesting - there was a refactoring recently where 'checkPageLoad' was split to 2 other functions (https://github.com/Microsoft/ApplicationInsights-JS/commit/da50064bfc6537fe7efe78ef1f5b048636f85070#diff-e25ffb54668c8e8794fb7224dbfadafbL112) However I don't see any issues with that - all usages of checkPageLoad were corrected accordingly.
Was it an intermittent issue or is it still reproducing? Do you have any custom code calling into AppInsights script, or it's just a snippet that you injected into your page?

Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception

I've updated HereMaps JavaScript from 2.2.4 to 2.5.3 and the map has stopped working on Chrome (version 31.0.1650.57 m). Firefox and IE work as before.
On the console I see the message many times
Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception base.js:158
TypeError: Cannot read property 'body' of undefined
Does anyone have a hint of what might be wrong?
Thanks.
It is very difficult to answer your specific problem without seeing your code, but I am able to produce a similar error which may help you track down your issue.
If you are getting multiple error messages, then it is likely that the JavaScript library itself is calling something periodically. From the text of the error it likely that the library is running a Coroutine, which is usually used for threading within the application.
The error I can produce is in a callback - if I add an overlay to the map, and deliberately try to access a non-existent property within my code I can get:
Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception base.js:158
TypeError: Cannot read property 'bar' of undefined
This was because I added a typo as follows:
I changed the reference from foo.something.bar in the callback to foo.does_not_exist.bar. So I guess somewhere in your callbacks you are referencing foo.something.body in your callback - it could be in a listener for example.
Another possibility, is that you are switching directly to Display.SATELLITE when you are creating the map - this is no longer allowed:
Taken from the News feed on developer.here.com:
Breaking changes with 2.5.3
The new rendering engine requires the map to be initialized
asynchronously. If you want to change the center, zoom level or the
base map type the API now requires the application to wait for the
"displayready" event to be fired. This event is only fired once.
Please refer to the developer's guide (section "Beyond the Basic Map Application
") for details.

Resources