13

I'm getting an error caught by Crashlytics and it's happening to almost 45% of the users but it doesn't seem to happen when the user is using the app but when it's in the background.

The stacktrace shown on Crashlytics is:

Fatal Exception: com.facebook.react.bridge.NoSuchKeyException ReadableNativeMap.java:124 lineNumber

I have no clue what can be causing this issue, if it's a Javascript error or a native library error

3
  • Noticing the same exception since today. react-native: 0.56.0, react-native-fbsdk: 0.8.0 Commented Apr 8, 2019 at 15:03
  • Same error on react-native 0.59.3, I believe some module should be blamed Commented Apr 9, 2019 at 21:32
  • 1
    Here is the bug report: github.com/facebook/react-native/issues/24382 Commented Apr 12, 2019 at 7:12

4 Answers 4

6

This is a problem caused by the stacktrace-parser library which is used internally by react native. Basically, release 0.1.4 works fine while releases 0.1.5 and 0.1.6 causes the lineNumber error.

Do the following to fix this:

  1. If you are using yarn add the following to your package.json:
  "resolutions": {
    "stacktrace-parser": "0.1.4"
  },

if you are using npm add the following to your package.json:

"dependencies": {
    ...
    "stacktrace-parser": "0.1.4"
  1. Remove the yarn.lock (or package-lock.json) file and the node_modules directory.
  2. Install the packages yarn install (or npm install)
  3. Rebuild your release build.

I hope this helps others until the library gets fixed.

Sign up to request clarification or add additional context in comments.

1 Comment

No, I have not tried with 0.1.8, but I am sure that they will solve the problem eventually. Once they do this answer will become obsolete. :)
1

My solution was to remove every console.error in my project.

https://github.com/facebook/react-native/issues/24382

Comments

0

Make sure "backgroundColor" value is never null or undefined. In my case that was the reason.

2 Comments

Do you know anyway I can reproduce thismissue locally, because it seems to be happening when the app is in background?
In my case, the crash also happened when the app is in background
-2

It ended up being an issue with some native library that was causing the crash. Simply upgrading it solved the problem

3 Comments

which native library? you should have mention that.
This answer is not useful, you should change to Francois's answer to be the accepted one
facing this problem for android os 4, after i migrated codebase from rn 0.59.9 to 0.60.5, can you mention which library causes the crash?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.