JSExecutionException: ReferenceError: Can't find variable: __fbBatchedBridge

情况如下:

进入到ReactActivity页面时,出现红色,读取不到js,这时已经有这条error打出了,但是这个是正常的,点击Menu-DevSetting后,再次出现这个error,并且程序crash。


具体如下:

E/unknown:React: Exception in native call from JS
                                                                                  com.facebook.react.bridge.JSExecutionException: ReferenceError: Can't find variable: __fbBatchedBridge (<unknown file>:1)
                                                                                      at com.facebook.react.bridge.ReactBridge.loadScriptFromAssets(Native Method)
                                                                                      at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:32)
                                                                                      at com.facebook.react.bridge.CatalystInstanceImpl$2.call(CatalystInstanceImpl.java:146)
                                                                                      at com.facebook.react.bridge.CatalystInstanceImpl$2.call(CatalystInstanceImpl.java:137)
                                                                                      at com.facebook.react.bridge.queue.MessageQueueThreadImpl$1.run(MessageQueueThreadImpl.java:73)
                                                                                      at android.os.Handler.handleCallback(Handler.java:725)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:92)
                                                                                      at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
                                                                                      at android.os.Looper.loop(Looper.java:137)
                                                                                      at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:184)
                                                                                      at java.lang.Thread.run(Thread.java:856)


这个是看了别人的解决方法。

具体原因还有些似懂非懂,先写下暂时的解决方式。


ReactInstanceManager的设定中有一个

setUseDeveloperSupport(boolean useDeveloperSupport)
When true, developer options such as JS reloading and debugging are enabled。

将这个值设为true可以简单的解决问题。具体原因,之后看了再续。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值