Could not get BatchedBridge, make sure your bundle is packaged correctly

react-native 运行android项目的时候运行成功但是模拟器上会提示:

Could not get BatchedBridge, make sure your bundle is packaged correctly 这个错误,到时不能正常运行。


在百度上搜索了这两篇文章

http://blog.csdn.net/b992379702b/article/details/52234479

http://blog.csdn.net/ssksuke/article/details/52403754?locationNum=6%E3%80%81

按照这两篇文章的执行思路去执行,会出现一个问题。就是提示error: option '--entry-file' missing。(不过这两篇文章的擦考意义比较大,要不是参考这两篇文章我不会那么快找到解决方法,还是非常感谢这两位同学提供的方案)

 

解决方法:

最后在github上了这一篇文章,运行给出的命令。android-react-native项目就能成功运行了。

http://stackoverflow.com/questions/38870710/error-could-not-get-batchedbridge-make-sure-your-bundle-is-packaged-properly/38874952

切换到项目根目录下执行如下命令:

react-native start > /dev/null 2>&1 & curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"

执行命令的代码如下图所示

 

posted on 2016-09-12 13:59  飘杨......  阅读(6074)  评论(0编辑  收藏  举报