diff --git a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java index b304fdb6..4d337213 100644 --- a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java +++ b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java @@ -62,10 +62,13 @@ public class RealmReactModule extends ReactContextBaseJavaModule { @Override public Map getConstants() { - if (!isContextInjected()) { - startWebServer(); + if (isContextInjected()) { + // No constants are needed if *not* running in Chrome debug mode. + return Collections.EMPTY_MAP; } + startWebServer(); + List hosts; if (RealmAnalytics.isRunningOnEmulator()) { hosts = Arrays.asList(new String[]{"localhost"});