facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.17k stars 24.21k forks source link

com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:79) #33916

Closed nmanvitha closed 1 year ago

nmanvitha commented 2 years ago

Description

Hi,

In Android the app randomly crashing with the below error. Got this in firebase crashlytics dashboard and there is no log to debug and reproduce. and We see this crash mostly happens on Samsung devices.

Fatal Exception: com.facebook.react.common.JavascriptException TypeError: null is not an object (evaluating 'U.networkType.value'), stack: onValueChange@1368:4730 onPress@954:1602 onPress@229:1700 value@225:7540 value@225:6753 onResponderRelease@225:5556 b@99:1125 S@99:1268 w@99:1322 R@99:1617 M@99:2401 forEach@-1 U@99:2201 @99:13818 Pe@99:90199 Re@99:13478 Ie@99:13664 receiveTouches@99:14448 value@40:3544 @40:840 value@40:2798 value@40:812 value@-1

Below are the dependencies.

"@burstware/react-native-portal": "^1.0.2", "@react-native-community/async-storage": "^1.9.0", "@react-native-community/datetimepicker": "3.0.0", "@react-native-community/geolocation": "^2.0.2", "@react-native-community/masked-view": "^0.1.7", "@react-native-community/netinfo": "^5.9.5", "@react-native-community/progress-bar-android": "^1.0.3", "@react-native-community/progress-view": "@1.1.1", "@react-native-firebase/analytics": "^7.4.2", "@react-native-firebase/app": "^8.3.1", "@react-native-firebase/crashlytics": "^8.3.3", "@react-navigation/bottom-tabs": "5.2.6", "@react-navigation/drawer": "5.0.5", "@react-navigation/material-bottom-tabs": "5.1.7", "@react-navigation/material-top-tabs": "5.1.7", "@react-navigation/native": "5.1.4", "@react-navigation/native-stack": "5.0.5", "@react-navigation/stack": "5.2.9", "android": "^0.0.8", "axios": "^0.19.2", "format-string-by-pattern": "^1.2.1", "jail-monkey": "^2.3.2", "jsc-android": "^245459.0.0", "moment": "^2.24.0", "patch-package": "^6.4.7", "prop-types": "^15.7.2", "react": "16.11.0", "react-native": "0.62.1", "react-native-add-calendar-event": "3.0.2", "react-native-awesome-card-io": "^0.8.3", "react-native-background-timer": "^2.2.0", "react-native-collapsible": "^1.5.2", "react-native-config": "1.3.3", "react-native-device-info": "^5.6.1", "react-native-document-picker": "^4.1.0", "react-native-easy-toast": "^1.2.0", "react-native-exit-app": "^1.1.0", "react-native-fs": "2.16.6", "react-native-gesture-handler": "1.8.0", "react-native-get-random-values": "^1.4.0", "react-native-htmlview": "^0.15.0", "react-native-image-base64": "0.1.4", "react-native-image-picker": "2.3.1", "react-native-image-resizer": "1.2.3", "react-native-image-zoom-viewer": "3.0.1", "react-native-in-app-review": "^2.1.5", "react-native-languages": "^3.0.2", "react-native-linear-gradient": "^2.5.6", "react-native-localization": "^2.1.6", "react-native-map-clustering": "^3.3.4", "react-native-maps": "^0.27.1", "react-native-modal": "^11.5.6", "react-native-orientation-locker": "^1.0.21", "react-native-pdf": "^6.2.0", "react-native-permissions": "2.1.4", "react-native-picker-select": "^6.6.0", "react-native-rate": "^1.2.1", "react-native-reanimated": "^1.8.0", "react-native-safe-area-context": "^0.7.3", "react-native-screens": "@2.4.0", "react-native-share": "^5.1.0", "react-native-signature-capture": "^0.4.11", "react-native-snap-carousel": "^3.9.0", "react-native-splash-screen": "^3.2.0", "react-native-sqlite-storage": "https://github.com/leorajdsouza/react-native-sqlite-storage.git", "react-native-svg": "^12.1.0", "react-native-tab-view": "2.13.0", "react-native-touch-id": "^4.4.1", "react-native-user-inactivity": "^1.1.0", "react-native-vector-icons": "6.6.0", "react-native-webview": "~9.1.4", "react-redux": "^7.2.0", "reanimated-bottom-sheet": "^1.0.0-alpha.19", "redux": "^4.0.5", "redux-logger": "^3.0.6", "redux-thunk": "^2.3.0", "rn-fetch-blob": "^0.12.0", "rn-secure-storage": "^2.0.4", "underscore": "^1.12.0"

Any solution??

Version

0.62.1

Output of npx react-native info

No response

Steps to reproduce

Got it in Firebase Crashlytics.

Snack, code example, screenshot, or link to a repository

No response

dmytrorykun commented 2 years ago

Hello @nmanvitha , TypeError: null is not an object (evaluating 'U.networkType.value') makes me think that this may be not a React Native issue. To help us investigate, please do the following:

github-actions[bot] commented 2 years ago
:warning: Missing Environment Information
:information_source: Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.
github-actions[bot] commented 2 years ago
:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.
nmanvitha commented 2 years ago

This issue i got in firebase crashlytics. There is no log and I'm unable to reproduce the crash.

dmytrorykun commented 2 years ago

@nmanvitha unfortunately without those details we cannot help. It is important for us to be sure that we are working on actual React Native issues here.

RowlandOti commented 2 years ago

I am also facing this issue - and just like you it happens in a way I can't reproduce, however, this is a log am seeing in my diagnostics.

santitopo commented 2 years ago

Same thing here. We are seeing crashes reported in the Play Store crashes & ANR console. This is all we get as the stack trace (I realize it might not be the same network error originally reported in this issue):

Title: com.facebook.react.modules.core.ExceptionsManagerModule.reportException Type: com.facebook.react.common.JavascriptException

Exception com.facebook.react.common.JavascriptException:
  at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72)
  at java.lang.reflect.Method.invoke
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188)
  at com.facebook.react.bridge.queue.NativeRunnable.run
  at android.os.Handler.handleCallback (Handler.java:751)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
  at android.os.Looper.loop (Looper.java:154)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:226)
  at java.lang.Thread.run (Thread.java:762)

happening in Android 7, 10, 11 and 12

sundarsharma2018 commented 2 years ago

I am facing same problem

toofast1 commented 2 years ago

Same problem for me, too (affected Android 10 and Android 12):

Exception com.facebook.react.common.JavascriptException:
  at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:83)
  at java.lang.reflect.Method.invoke
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:151)
  at com.facebook.react.bridge.queue.NativeRunnable.run
  at android.os.Handler.handleCallback (Handler.java:883)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
  at android.os.Looper.loop (Looper.java:214)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:226)
  at java.lang.Thread.run (Thread.java:919)
luizuk commented 2 years ago

Does someone with any solution or idea? I'm facing now this issue.

neon010 commented 2 years ago

I am also getting this error in production? does anyone have idea ?

Exception r5.c: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java) at java.lang.reflect.Method.invoke (Method.java) at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java) at com.facebook.react.bridge.queue.NativeRunnable.run (NativeRunnable.java) at android.os.Handler.handleCallback (Handler.java:907) at android.os.Handler.dispatchMessage (Handler.java:105) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java) at android.os.Looper.loop (Looper.java:216) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java) at java.lang.Thread.run (Thread.java:784)

AmrithVengalath commented 2 years ago

I'm facing the same issue

masarbazi commented 2 years ago

Same here. Crash reports on Play Console

millro04 commented 1 year ago

Same issue here, has anyone found any solutions to this?

youssinsa commented 1 year ago

Same issue here, if anyone have an idea :)

truongphanqui commented 1 year ago

Crash report on Play Console. And have no ideal how fix it. And the most crash is on Android 10.

n-kulic commented 1 year ago

Same issue, happened on Android 11 (SDK 30)

Exception com.facebook.react.common.JavascriptException:
  at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72)
  at java.lang.reflect.Method.invoke
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188)
  at com.facebook.react.bridge.queue.NativeRunnable.run
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
  at android.os.Looper.loop (Looper.java:246)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228)
  at java.lang.Thread.run (Thread.java:923)

Version:

dunicn commented 1 year ago

Same issue here, too.

yurachumak commented 1 year ago

The same issue, any solutions?

dunicn commented 1 year ago

The same issue, any solutions?

No, not yet

serveroid commented 1 year ago

The same issue, any solutions?

rezq2009 commented 1 year ago

Same issue, happened on

Android 11 (SDK 30) Android 12 (SDK 31) Android 10 (SDK 29) Android 9 (SDK 28)

com.facebook.react.common.JavascriptException

Exception com.facebook.react.common.JavascriptException:
  at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72)
  at java.lang.reflect.Method.invoke
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188)
  at com.facebook.react.bridge.queue.NativeRunnable.run
  at android.os.Handler.handleCallback (Handler.java:809)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
  at android.os.Looper.loop (Looper.java:166)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228)
  at java.lang.Thread.run (Thread.java:784)

Verstions : react: 17.0.2 react-native: 0.68.1

any solutions?

n-kulic commented 1 year ago

@dunicn @rezq2009 can you paste your app dependencies? I want too see if it's related to some package

<details>
<summary>package.json dependencies</summary>

[paste dependencies from package.json here]  
</details>

Here's mine:

package.json dependencies "dependencies": { "@emotion/native": "^11.0.0", "@emotion/react": "^11.9.0", "@react-native-async-storage/async-storage": "^1.17.6", "@react-native-community/netinfo": "^9.0.0", "@react-navigation/native": "^6.0.10", "@react-navigation/stack": "^6.2.1", "@reduxjs/toolkit": "^1.8.2", "axios": "^0.27.2", "crypto-js": "^4.1.1", "geolib": "^3.3.3", "lodash.debounce": "^4.0.8", "react": "17.0.2", "react-native": "0.68.2", "react-native-attitude": "^2.2.1", "react-native-config": "^1.4.5", "react-native-fs": "^2.20.0", "react-native-geolocation-service": "^5.3.0", "react-native-gesture-handler": "^2.4.2", "react-native-get-random-values": "^1.8.0", "react-native-indicators": "^0.17.0", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-keychain": "^8.0.0", "react-native-linear-gradient": "^2.5.6", "react-native-maps": "^0.31.1", "react-native-modal": "^13.0.1", "react-native-pager-view": "^5.4.24", "react-native-permissions": "^3.3.1", "react-native-popup-menu": "^0.15.12", "react-native-safe-area-context": "^4.2.5", "react-native-screens": "^3.13.1", "react-native-svg": "^12.3.0", "react-native-toast-message": "^2.1.5", "react-native-vision-camera": "^2.13.5", "react-redux": "^8.0.2", "redux-persist": "^6.0.0", "uuid": "^8.3.2" },
rezq2009 commented 1 year ago

hi @n-kulic

The dependencie that I use from your list is only react-native-permissions

I don't think this is the package related problem.

adarshkhatri commented 1 year ago

Similar thing is happening on my end too:

Exception com.facebook.react.common.JavascriptException: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72) at java.lang.reflect.Method.invoke at java.lang.reflect.Method.invoke (Method.java:372) at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188) at com.facebook.react.bridge.queue.NativeRunnable.run at android.os.Handler.handleCallback (Handler.java:739) at android.os.Handler.dispatchMessage (Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27) at android.os.Looper.loop (Looper.java:135) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228) at java.lang.Thread.run (Thread.java:818)

ysng007 commented 1 year ago

Same issue

react: 16.11.0 react-native: 0.62.2

any solutions?

dkjeune commented 1 year ago

com.facebook.react.modules.core.ExceptionsManagerModule.reportException com.facebook.react.common.JavascriptException

Same problem for me

"react": "17.0.2", "react-native": "0.68.0",

neel132 commented 1 year ago

Facing the same issue.. Any resolution ?

mehul1992 commented 1 year ago

Same issue I am facing

orodrigu commented 1 year ago

Tengo el mismo problema, alguien lo soluciono?

orodrigu commented 1 year ago

Facing the same issue.. Any resolution ?

azzi907 commented 1 year ago

Facing the same issue... Any solution yet ?

damroyan commented 1 year ago

Same issue

hassey13 commented 1 year ago

I have the same issue but in getting deeper in the logs I found the actual error, which is unrelated to react native. If you have this I would recommend a better crash reporting lib or on the device to use adb get the logs and get the error.

jhonnathanH commented 1 year ago

same issue

pbayog00 commented 1 year ago

Facing same issue here seen in Crashlytics crash log but unnable to reproduce

zhiln commented 1 year ago

Facing the same issue

ritambratakarak commented 1 year ago

i have same issue with com.facebook.react.modules.core.ExceptionsManagerModule.reportException com.facebook.react.common.JavascriptException

"react": "17.0.2", "react-native": "0.67.2",

siddesh94 commented 1 year ago

In my latest release, this crash is causing too frequently.

HanggiAnggono commented 1 year ago

i'm having the same issue

jeffinhk commented 1 year ago

having same issue here

kotsh23 commented 1 year ago

same issue here :D

k3nnet commented 1 year ago

same here , here is my stack trace Exception com.facebook.react.common.JavascriptException: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72) at java.lang.reflect.Method.invoke at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188) at com.facebook.react.bridge.queue.NativeRunnable.run at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27) at android.os.Looper.loop (Looper.java:246) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228) at java.lang.Thread.run (Thread.java:923)

monokaijs commented 1 year ago

Seems like problem was caused by ProGuard. You can try disabling it by modifying your app's build.gradle (which is located in ./android/app/build.gradle) Set:

minifyEnabled false
useProguard false

So your buildTypes configuration section looks like this:

buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
    release {
        // disable proguard
        minifyEnabled false
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

Goodluck.

jeffinhk commented 1 year ago

Not the best answer out here, but in my case I increased the target SDK and maximum SDK to 33 (latest).

k3nnet commented 1 year ago

Seems like problem was caused by ProGuard. You can try disabling it by modifying your app's build.gradle (which is located in ./android/app/build.gradle) Set:

minifyEnabled false
useProguard false

So your buildTypes configuration section looks like this:

buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
    release {
        // disable proguard
        minifyEnabled false
        useProguard false
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

Goodluck.

Thanks . i am trying it out. crossing my fingers that its a fix . i'll let you know how it goes .

monokaijs commented 1 year ago

Don't use useProguard false if you're using newer versions of React otherwise it will prevent you from building application. A clean build is also required.

k3nnet commented 1 year ago

disabling Proguard or bumping up the target SDK doesn't seem to resolve my issue @monokaijs @jeffinhk . my app is still crashing on start up after install . although now i am getting a different error . i am using expo managed workflow and disabling proguard in app.json like so "enableProguardInReleaseBuilds":false , now i am getting this error java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: java_object == null

HyopeR commented 1 year ago

I'm having the same problem. And I can't reproduce.

vaish8529 commented 1 year ago

Got similar issue. Any solution?