-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Description
Description
use React Native 0.80.2 , want to launch Muti bundle on demand, what to do this?
ReactDelegate.java
public void loadApp(String appKey) {
if (ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture()) {
if (this.mReactSurface == null) {
this.mReactSurface = this.mReactHost.createSurface(this.mActivity, appKey, this.mLaunchOptions);
}
this.mReactSurface.start();
} else {
if (this.mReactRootView != null) {
throw new IllegalStateException("Cannot loadApp while app is already running.");
}
this.mReactRootView = this.createRootView();
this.mReactRootView.startReactApplication(this.getReactNativeHost().getReactInstanceManager(), appKey, this.mLaunchOptions);
}
}
app launch, download new bundle ,and load, I can see this.mReactSurface.start(); but preload Muti bundle ? how to do this?
Steps to reproduce
: FATAL EXCEPTION: mqt_v_native
09-17 15:38:01.538 19241 19571 E AndroidRuntime: Process: com.ecoflow, PID: 19241
09-17 15:38:01.538 19241 19571 E AndroidRuntime: com.facebook.react.common.JavascriptException: Invariant Violation: "1757915963079_RN_AiChat" has not been registered. This can happen if:
09-17 15:38:01.538 19241 19571 E AndroidRuntime: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
09-17 15:38:01.538 19241 19571 E AndroidRuntime: * A module failed to load due to an error and AppRegistry.registerComponent
wasn't called., js engine: hermes, stack:
09-17 15:38:01.538 19241 19571 E AndroidRuntime: anonymous@115:289
09-17 15:38:01.538 19241 19571 E AndroidRuntime: anonymous@304:1103
09-17 15:38:01.538 19241 19571 E AndroidRuntime:
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.kt:52)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.jni.NativeRunnable.run(Native Method)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:958)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.kt:21)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:205)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Looper.loop(Looper.java:294)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.startNewBackgroundThread$lambda$1(MessageQueueThreadImpl.kt:175)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.$r8$lambda$ldnZnqelhYFctGaUKkOKYj5rxo4(Unknown Source:0)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1119)
React Native Version
0.80.2
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
npx @react-native-community/cli info
info Fetching system and libraries information...
System:
OS: macOS 15.5
CPU: (14) arm64 Apple M4 Pro
Memory: 192.77 MB / 48.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 24.7.0
path: /opt/homebrew/bin/node
Yarn:
version: 1.22.22
path: /opt/homebrew/bin/yarn
npm:
version: 11.5.1
path: /opt/homebrew/bin/npm
Watchman:
version: 2025.09.08.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK: Not Found
Android SDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.26094.121.2513.14007798
Xcode:
version: /undefined
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.16
path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.0.2
wanted: latest
react:
installed: 19.1.1
wanted: ^19.1.0
react-native:
installed: 0.80.2
wanted: 0.80.2
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
info React Native v0.81.4 is now available (your project is running on v0.80.2).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.81.4
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.80.2&to=0.81.4
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Stacktrace or Logs
: FATAL EXCEPTION: mqt_v_native
09-17 15:38:01.538 19241 19571 E AndroidRuntime: Process: com.ecoflow, PID: 19241
09-17 15:38:01.538 19241 19571 E AndroidRuntime: com.facebook.react.common.JavascriptException: Invariant Violation: "1757915963079_RN_AiChat" has not been registered. This can happen if:
09-17 15:38:01.538 19241 19571 E AndroidRuntime: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
09-17 15:38:01.538 19241 19571 E AndroidRuntime: * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes, stack:
09-17 15:38:01.538 19241 19571 E AndroidRuntime: anonymous@115:289
09-17 15:38:01.538 19241 19571 E AndroidRuntime: anonymous@304:1103
09-17 15:38:01.538 19241 19571 E AndroidRuntime:
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.kt:52)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.jni.NativeRunnable.run(Native Method)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:958)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.kt:21)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:205)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at android.os.Looper.loop(Looper.java:294)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.startNewBackgroundThread$lambda$1(MessageQueueThreadImpl.kt:175)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.$r8$lambda$ldnZnqelhYFctGaUKkOKYj5rxo4(Unknown Source:0)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
09-17 15:38:01.538 19241 19571 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1119)
MANDATORY Reproducer
Screenshots and Videos
No response