react-native-orientation-locker
react-native-orientation-locker copied to clipboard
[Android] When Hermes is enabled app crashes in release mode
When enabling the Hermes JavaScript engine for Android the app crashes immediately at launch:
java.lang.IllegalArgumentException: Receiver not registered: org.wonday.orientation.OrientationModule$2@4c0425a
This issue only occurs when building the app in release configuration and with JS bundled in the app. I guess this has something to do the way Hermes compiles JS to bytecode.
Seeing the same thing (without Hermes, actually - React Native 0.59.10). Here is my full stack trace - note this seems to happen during the Google build-bot test, when it closes the app:
10-16 07:16:56.320: W/unknown:ReactNative(9889): Receiver already unregistered
10-16 07:16:56.320: W/unknown:ReactNative(9889): java.lang.IllegalArgumentException: Receiver not registered: org.wonday.orientation.OrientationModule$2@2833021
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1095)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1503)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:608)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at org.wonday.orientation.OrientationModule.onHostDestroy(OrientationModule.java:375)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.facebook.react.bridge.ReactContext.onHostDestroy(ReactContext.java:237)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.facebook.react.ReactInstanceManager.moveToBeforeCreateLifecycleState(ReactInstanceManager.java:687)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:596)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:610)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.facebook.react.ReactActivityDelegate.onDestroy(ReactActivityDelegate.java:117)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.facebook.react.ReactActivity.onDestroy(ReactActivity.java:70)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.Activity.performDestroy(Activity.java:7136)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.Instrumentation.callActivityOnDestroy(Instru
mentation.java:1158)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at androidx.test.runner.MonitoringInstrumentation.callActivityOnDestroy(MonitoringInstrumentation.java:177)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4385)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4417)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.ActivityThread.-wrap6(ActivityThread.java)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1629)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.os.Handler.dispatchMessage(Handler.java:105)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.os.Looper.loop(Looper.java:156)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at android.app.ActivityThread.main(ActivityThread.java:6524)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at java.lang.reflect.Method.invoke(Native Method)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
10-16 07:16:56.320: W/unknown:ReactNative(9889): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Same Problem here, i think this is tied to the Installation of react-native-gesture-handler? Since i added
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
in MainActivity.java i have these crashes. @wonday
ok got it. the issue for me was in react-native-gesture-handler
adding import 'react-native-gesture-handler'
on top of my index.js file fixed it for me (more info)
It's not work to me, still crash "react-native": "^0.59.8", "react-native-orientation-locker": "^1.1.1", "react-native-gesture-handler": "^1.3.0",
It's not work to me, still crash "react-native": "^0.59.8", "react-native-orientation-locker": "^1.1.1", "react-native-gesture-handler": "^1.3.0",
Did you put the import on TOP of your upmost index.js?
@MarianBe react-native-gesture-handler
1.5.2 should fix the issue and allow you to remove that import: https://github.com/software-mansion/react-native-gesture-handler/issues/320#issuecomment-562148017
It's not work to me, still crash "react-native": "^0.59.8", "react-native-orientation-locker": "^1.1.1", "react-native-gesture-handler": "^1.3.0",
Did you put the import on TOP of your upmost index.js?
does it work for you? cause it is not work for me. i am still facing the issue
"react-native": "^0.61.5", "react-native-orientation-locker": "^1.1.8", "react-native-gesture-handler": "^1.6.0",
@wonday could you help me please?
It's not work to me, still crash "react-native": "^0.59.8", "react-native-orientation-locker": "^1.1.1", "react-native-gesture-handler": "^1.3.0",
Did you put the import on TOP of your upmost index.js?
does it work for you? cause it is not work for me. i am still facing the issue
"react-native": "^0.61.5", "react-native-orientation-locker": "^1.1.8", "react-native-gesture-handler": "^1.6.0",
@wonday could you help me please?
i am sorry. its okay now. i made a mistake when using moment for setting local time which the error is not shown in debug mode
Still experiencing that with:
"react-native-orientation-locker": "1.3.1", "react-native-gesture-handler": "1.10.3",
AND I'm importing react-native-gesture-handler
on init too.
Any ideas?