Skip to content

Commit 1131831

Browse files
luluwu2032facebook-github-bot
authored andcommitted
Add ExceptionsManagerModule for RNTester
Summary: Fix the following issue: ```Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'ExceptionsManager' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: true. TurboModule interop: true. Modules loaded: {"NativeModules":[],"TurboModules": ["PlatformConstants","AppState","SourceCode","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","LogBox","Networking","Appearance","DevLoadingView","DeviceInfo","DeviceEventManager", "SoundManager","ImageLoader","DialogManagerAndroid","NativeAnimatedModule","I18nManager","AccessibilityInfo","StatusBarManager","StatusBarManager","IntentAndroid","ToastAndroid","ShareModule","Vibration"], "NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","HeadlessJsTaskSupport","FrameRateLogger","KeyboardObserver", "AccessibilityManager","ModalManager","LinkingManager","ActionSheetManager","ExceptionsManager"]} ``` Changelog: [Android][Changed] - Add Add ExceptionsManagerModule to CoreReactPackage Reviewed By: cortinico Differential Revision: D50017783
1 parent c279db7 commit 1131831

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.facebook.react.module.model.ReactModuleInfoProvider;
2121
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
2222
import com.facebook.react.modules.core.DeviceEventManagerModule;
23+
import com.facebook.react.modules.core.ExceptionsManagerModule;
2324
import com.facebook.react.modules.debug.DevSettingsModule;
2425
import com.facebook.react.modules.debug.SourceCodeModule;
2526
import com.facebook.react.modules.deviceinfo.DeviceInfoModule;
@@ -36,6 +37,7 @@
3637
SourceCodeModule.class,
3738
LogBoxModule.class,
3839
DeviceEventManagerModule.class,
40+
ExceptionsManagerModule.class,
3941
})
4042
class CoreReactPackage extends TurboReactPackage {
4143

@@ -63,6 +65,8 @@ public NativeModule getModule(String name, ReactApplicationContext reactContext)
6365
return new DeviceEventManagerModule(reactContext, mHardwareBackBtnHandler);
6466
case LogBoxModule.NAME:
6567
return new LogBoxModule(reactContext, mDevSupportManager);
68+
case ExceptionsManagerModule.NAME:
69+
return new ExceptionsManagerModule(mDevSupportManager);
6670
default:
6771
throw new IllegalArgumentException(
6872
"In BridgelessReactPackage, could not find Native module for " + name);
@@ -85,6 +89,7 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
8589
DevSettingsModule.class,
8690
DeviceEventManagerModule.class,
8791
LogBoxModule.class,
92+
ExceptionsManagerModule.class,
8893
};
8994
final Map<String, ReactModuleInfo> reactModuleInfoMap = new HashMap<>();
9095
for (Class<? extends NativeModule> moduleClass : moduleList) {

packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ import com.facebook.soloader.SoLoader
3939

4040
class RNTesterApplication : Application(), ReactApplication {
4141
override val reactNativeHost: ReactNativeHost by lazy {
42-
if (ReactFeatureFlags.enableBridgelessArchitecture) {
43-
throw RuntimeException("Should not use ReactNativeHost when Bridgeless enabled")
44-
}
4542
object : DefaultReactNativeHost(this) {
4643
public override fun getJSMainModuleName(): String = BuildConfig.JS_MAIN_MODULE_NAME
4744

0 commit comments

Comments
 (0)