Skip to content

Commit

Permalink
Add ExceptionsManagerModule for RNTester (facebook#40767)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#40767

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

fbshipit-source-id: 8642bb23bdae50a1e702f5e0586b0ede80007bb1

# Conflicts:
#	packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt
  • Loading branch information
Lulu Wu authored and huntie committed Oct 18, 2023
1 parent 7193bd7 commit 034d815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -19,6 +19,7 @@
import com.facebook.react.module.model.ReactModuleInfoProvider;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.modules.core.ExceptionsManagerModule;
import com.facebook.react.modules.debug.DevSettingsModule;
import com.facebook.react.modules.debug.SourceCodeModule;
import com.facebook.react.modules.deviceinfo.DeviceInfoModule;
Expand All @@ -36,6 +37,7 @@
SourceCodeModule.class,
LogBoxModule.class,
DeviceEventManagerModule.class,
ExceptionsManagerModule.class,
})
class CoreReactPackage extends TurboReactPackage {

Expand Down Expand Up @@ -63,6 +65,8 @@ public NativeModule getModule(String name, ReactApplicationContext reactContext)
return new DeviceEventManagerModule(reactContext, mHardwareBackBtnHandler);
case LogBoxModule.NAME:
return new LogBoxModule(reactContext, mDevSupportManager);
case ExceptionsManagerModule.NAME:
return new ExceptionsManagerModule(mDevSupportManager);
default:
throw new IllegalArgumentException(
"In BridgelessReactPackage, could not find Native module for " + name);
Expand All @@ -85,6 +89,7 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
DevSettingsModule.class,
DeviceEventManagerModule.class,
LogBoxModule.class,
ExceptionsManagerModule.class,
};
final Map<String, ReactModuleInfo> reactModuleInfoMap = new HashMap<>();
for (Class<? extends NativeModule> moduleClass : moduleList) {
Expand Down
Expand Up @@ -170,9 +170,6 @@ public void onCreate() {

@Override
public ReactNativeHost getReactNativeHost() {
if (ReactFeatureFlags.enableBridgelessArchitecture) {
throw new RuntimeException("Should not use ReactNativeHost when Bridgeless enabled");
}
return mReactNativeHost;
}

Expand Down

0 comments on commit 034d815

Please sign in to comment.