无法获得 BatchedBridge,请确保您的捆绑包已正确打包 [英] Could not get BatchedBridge, make sure your bundle is packaged correctly

查看:101
本文介绍了无法获得 BatchedBridge,请确保您的捆绑包已正确打包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Android 中遇到 react-native 的问题(无法获得 BatchedBridge,请确保您的捆绑包已正确打包)[![在此处输入图片描述][1]][1]

i am having problem with react-native in Android (Could not get BatchedBridge, make sure your bundle is packaged correctly ) [![enter image description here][1]][1]

我尝试了一切:将 npm、react-native、react 和 package.json 中的所有依赖项更新到最新版本,我删除了 node_modules 并重新安装,清除缓存 ... atc

i tried everything : update npm , react-native ,react and all dependencies in package.json to last versions , i removed node_modules and reinstall it again , clear cache ... 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) 

推荐答案

对我有用的是以下内容.

What worked for me was the following.

运行 npm start 这给了我一个错误 ENOSPC.我用这个答案修复了这个错误 https://stackoverflow.com/a/32600959/706798.

Running npm start which gave me an error ENOSPC. I fixed that error with this answer https://stackoverflow.com/a/32600959/706798.

然后我再次运行 react-native run-android,一切正常!

Then I ran react-native run-android again, and everything worked!

这篇关于无法获得 BatchedBridge,请确保您的捆绑包已正确打包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆