Fatal Exception: com.facebook.react.common.JavascriptException Error: react-native-permissions: NativeModule.RNPermissions is null

218 views Asked by At

We are facing strange crash which is happening to some devices with live playstore version of the app, we have error logging setup with firebase crashlytics, smartlook and testfairy - at all 3 places we are getting same error log, suddenly our users started facing this in a stable app.

Here is the full bug report

Fatal Exception: com.facebook.react.common.JavascriptException: Error: react-native-permissions: NativeModule.RNPermissions is null. To fix this issue try these steps: • If you are using CocoaPods on iOS, run pod installin theios` directory and then clean, rebuild and re-run the app. You may also need to re-open Xcode to get the new pods. • If you are getting this error while unit testing you need to mock the native module. You can use this to get started: https://github.com/zoontek/react-native-permissions/blob/master/mock.js If none of these fix the issue, please open an issue on the Github repository: https://github.com/zoontek/react-native-permissions, js engine: hermes, stack: anonymous@1943:1018 h@2:1585 d@2:958 o@2:496 Pe@2161:18604 anonymous@2161:18014 Ul@55:66831 ja@55:84504 anonymous@55:82832 Y@177:2883 e@177:400 anonymous@84:1256 k@84:499 callTimers@84:2652 value@36:3556 anonymous@36:673 value@36:2503 value@36:645

   at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:72)
   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:188)
   at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
   at android.os.Handler.handleCallback(Handler.java:942)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
   at android.os.Looper.loopOnce(Looper.java:226)
   at android.os.Looper.loop(Looper.java:313)
   at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
   at java.lang.Thread.run(Thread.java:1012)`

We are using react-native-permissions 3.6.1

Since it is only happening with live version of the app we do not have solid reproduction steps. we are using checkNotifications() function on the screen where the app is crashing

`checkNotifications() .then(({status}) => {

    check(
      Platform.OS === 'ios'
        ? PERMISSIONS.IOS.CAMERA
        : PERMISSIONS.ANDROID.CAMERA,
    )
      .then(result => {

      })
      .catch(() => {

      });
  })
  .catch(() => {

  });

`};

0

There are 0 answers

Related Questions in REACT-NATIVE-PERMISSIONS