这仅在 Android 平台上发生,用于发布版本。我安装应用程序,打开它,终止应用程序,然后再次打开它。应用程序崩溃,我收到以下错误:
com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java:-2)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:762)
之后一切正常。即使我从头开始重复这些步骤,我也无法重现崩溃。
我浏览了 StackOverflow 和 Github 上的所有问题,但仍然没有找到答案。我在那里发现的唯一一件事是 Hermes 可能是崩溃的原因,但即使我禁用了 Hermes,崩溃仍在发生。
我的环境是
OS: macOS 11.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 1.70 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 10.18.1 - ~/.nvm/versions/node/v10.18.1/bin/node
Yarn: 1.22.11 - ~/.nvm/versions/node/v10.18.1/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v10.18.1/bin/npm
Watchman: 2021.08.23.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
Android SDK:
API Levels: 26, 29, 30
Build Tools: 29.0.2, 30.0.3
System Images: android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Languages:
Java: 1.8.0_292 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
react-native-macos: Not Found