我在Android中遇到react-native问题 (无法获得BatchedBridge,请确保您的包装正确包装) [![在此处输入图像说明] [1]] [1]
我尝试了一切:更新npm,react-native,react和package.json中的所有依赖项到最后版本, 我删除了node_modules并重新安装它,清除缓存... atc
错误日志
04-25 03:35:49.874 11688-11814/com.test.store E/AndroidRuntime: FATAL EXCEPTION: mqt_js
Process: com.test.store, PID: 11688
java.lang.RuntimeException: com.facebook.react.devsupport.JSException: Could not get BatchedBridge, make sure your bundle is packaged correctly
at com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler.handleException(DefaultNativeModuleCallExceptionHandler.java:24)
at com.facebook.react.devsupport.DisabledDevSupportManager.handleException(DisabledDevSupportManager.java:161)
at com.facebook.react.cxxbridge.CatalystInstanceImpl.onNativeException(CatalystInstanceImpl.java:465)
at com.facebook.react.cxxbridge.CatalystInstanceImpl.access$400(CatalystInstanceImpl.java:51)
at com.facebook.react.cxxbridge.CatalystInstanceImpl$NativeExceptionHandler.handleException(CatalystInstanceImpl.java:481)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:33)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:761)
Caused by: com.facebook.react.devsupport.JSException: Could not get BatchedBridge, make sure your bundle is packaged correctly
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
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:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:761)
Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
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:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:761)
答案 0 :(得分:0)
我也遇到了同样的问题然后我按照这个答案(error "Could not get BatchedBridge, make sure your bundle is packaged properly" on start of app)并且它就像一个魅力......
干杯:)
答案 1 :(得分:0)
react-native-router-flux
包目前存在错误。它包括一个反复原生的重复实例。您需要做的只是npm install
您的包,然后删除重复的react-native条目。
rm -r ./node_modules/react-native-router-flux/node_modules/react-native
答案 2 :(得分:0)
对我来说,问题是' adb'没被认出来。当我尝试运行我的项目时,没有明显迹象表明adb'有问题,但是当我尝试运行空白项目时,它显示了命令&ad;' adb'不被承认。
要解决此问题,请将C:\ Users \ USERNAME \ AppData \ Local \ Android \ sdk \ platform-tools添加到环境变量
答案 3 :(得分:0)
对我有用的是以下内容。
正在运行npm start
给我一个错误ENOSPC
。
我用这个答案https://stackoverflow.com/a/32600959/706798修正了这个错误。
然后我又跑了react-native run-android
,一切正常!