question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on reportSoftException when lineNumber is missing

See original GitHub issue

šŸ› Bug Report

Android app crashes when ExceptionsManagerModule.reportSoftException is called with a stack trace that has frames without lineNumber.

The following fatal exception is logged.

2019-04-09 16:14:29.742 7083-7781/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: co.armortext.messenger, PID: 7083
    com.facebook.react.bridge.NoSuchKeyException: lineNumber
        at com.facebook.react.bridge.ReadableNativeMap.getValue(ReadableNativeMap.java:124)
        at com.facebook.react.bridge.ReadableNativeMap.getValue(ReadableNativeMap.java:128)
        at com.facebook.react.bridge.ReadableNativeMap.getInt(ReadableNativeMap.java:182)
        at com.facebook.react.util.JSStackTrace.format(JSStackTrace.java:28)
        at com.facebook.react.modules.core.ExceptionsManagerModule.reportSoftException(ExceptionsManagerModule.java:46)
        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:158)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        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$4.run(MessageQueueThreadImpl.java:232)
        at java.lang.Thread.run(Thread.java:764)

When app is running in debug mode something like this can be shown in red box:

reportSoftException

To Reproduce

Log exception via console.error with stack that has frames without line numbers.

Expected Behavior

App should not crash and exception stack trace should be formatted without line numbers similar to how it’s shown in red box.

Code Example

I don’t have a good code sample but it’s clear that problem is in the following code, where certain fields are assumed to be always present:

https://github.com/facebook/react-native/blob/97eb53d14fca0197a0d8b0066314b9a148f5f254/ReactAndroid/src/main/java/com/facebook/react/util/JSStackTrace.java#L28

Environment

info React Native Environment Info: System: OS: macOS 10.14.4 CPU: (8) x64 IntelĀ® Coreā„¢ i7-4850HQ CPU @ 2.30GHz Memory: 1.31 GB / 16.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 11.13.0 - /usr/local/bin/node Yarn: 1.15.2 - /usr/local/bin/yarn npm: 6.7.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2 Android SDK: API Levels: 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28 Build Tools: 26.0.1, 26.0.2, 27.0.0, 27.0.3, 28.0.0, 28.0.0, 28.0.2, 28.0.3, 29.0.0 System Images: android-21 | Intel x86 Atom, android-21 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: 10.2/10E125 - /usr/bin/xcodebuild npmPackages: react: 16.8.6 => 16.8.6 react-native: 0.59.4 => 0.59.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:43 (1 by maintainers)

github_iconTop GitHub Comments

20reactions
yogeshchoudhary147commented, Apr 18, 2019

Hi everyone,

We have figured it out.

It started due a version bump in one of transitive dependencies of react-native i.e. stacktrace-parser. On 5th April, they released 0.1.5 and this crash started happening.

I can confirm that downgrading it to 0.1.4, by specifying it in package.json, has resolved the issue for us.

20reactions
pearlismylovecommented, Apr 16, 2019

I’m using react-native 0.59 and experiencing this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native app crashes when destroying the app, only on ...
When destroying the app, the app crashes with a com.facebook.react.bridge.NoSuchKeyException. This is exclusive to Android. The crash happensĀ ...
Read more >
[facebook/react-native] Crash on reportSoftException when ...
Android app crashes when ExceptionsManagerModule.reportSoftException is called with a stack trace that has frames without lineNumber. The following fatalĀ ...
Read more >
[Solved] Facing the issue while running release-sdk.sh
while taking the dump, app stopped crashing…let me uninstall and install it once again and capture the dump. Time will be 1:11AM onwards....
Read more >
react-native - Crash pada reportSoftException saat lineNumber ...
React-native: Crash pada reportSoftException saat lineNumber hilang Ā· Laporan Bug. Aplikasi Android mengalami error saat ExceptionManagerModule. Ā· UntukĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found