【React Native】React Native之Could not get BatchedBridge,make sure...的问题
来源:互联网 发布:电脑应用无法链接网络 编辑:程序博客网 时间:2024/05/16 16:17
下载了一个项目,npm install安装之后,再次运行,却出现Could not get BatchedBridge,make sure your bundle is packaged correctly的错误。
长这个样:
先说解决方法:
1 . 在项目的android/app/src/main目录下,新建一个assets文件夹。
2 . 在项目的根目录下,通过git-cmd运行命令:
react-native bundle –platform android –dev false –entry-file index.android.js –bundle-output android/app/src/main/assets/index.android.bundle –assets-dest android/app/src/main/res/
命令执行完到这里就可以了。
注意:如果没有新建assets文件夹就执行命令行,会出现no such file or directory的错误
原因:
这是因为Bundle文件和包文件夹不正确导致。新建的文件夹会出来bundle.js文件。而运行调用时查找直接assets目录并不存在,需要手动创建。
index.android.bundle调用的是原生控件的js脚本,index.android.js通过bundle调用原生控件js脚本,当改变了 index.android.js,都需要使用上面的代码片段,来及时的更新index.android.bundle,然后打包才可以把新的index.android.js应用上,当没有index.android.bundle文件时,RN项目是无法运行的。
更多参考:http://www.open-open.com/lib/view/open1477469117948.html
- 【React Native】React Native之Could not get BatchedBridge,make sure...的问题
- react-native 运行报Could not get BatchedBridge, make sure your bundle is packaged correctly 错误
- React-native 常见错误:Could not get BatchedBridge, make sure your bundle is packaged correctly
- react-native报错Could not get BatchedBridge, make sure your bundle is packaged correctly
- React Native 报错 Could not get BatchedBridge, make sure your bundle is packaged correctly.
- react native 问题(mac系统) Could not get BatchedBridge, make sure your bundle is packaged correctly 问题解决
- 安卓嵌入react native 环境的步骤,Could not get BatchedBridge, make sure your bundle is packaged correctly问题的解决
- React Native error “Could not get BatchedBridge
- React Native 解决 Could not get BatchedBridge
- React-native打包遇到问题:Could not get BatchedBridge
- react-native could not get batchbridge,make sure bundle is packaged correctly
- could not get batchedbridge make sure
- 红屏问题"Could not get BatchedBridge, make sure your bundle is packaged correctly"
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- could not get batchedbridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged properly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- could not get batchedbridge, make sure your bundle is packaged correctly
- java.sql.SQLException: Access denied for user 'somebody'@'localhost'
- 车牌识别无感支付是什么?
- jsp标签的用法
- session的一些常用方法
- 2017.07.01 上午咨询总结
- 【React Native】React Native之Could not get BatchedBridge,make sure...的问题
- 文章标题
- 八大排序算法(4) 堆排序
- poj 1149网络流建模(转载自Edelweiss代码自己编的有点丑陋0 0)
- 40亿个非负整数中找到没出现的数
- 网络征信服务
- 解压版的Tomcat注册成 Windows操作系统服务
- BZOJ 1227 DP+树状数组 解题报告
- 初识Activiti流程设计工具