reactnative could not get batchedbridge, make sure your bundle is packaged correctly

真机运行时,报如题错误:“could not get batchedbridge, make sure your bundle is packaged correctly”,原因:如果时ios系统,那么不用问scheme的Build Configuration的值是Debug;

解决办法:

ios:

第一种:Build Configuration改为Release,解决!
第二种:关闭掉你手动开启的npm终端窗口 或 关闭正在运行该项目的模拟器,直接xcode->run运行!(Debug的环境,会根据根据代码修改动态修改布局,当npm关闭时,app不能正常工作了)

Android:

摇动手机,出现菜单,选择Dev Settings,设置Dubug server host & port for device,设置IP和端口,找出自己的本机ip后面接8081端口,然后返回刷新界面或者重新运行,解决!

你可能感兴趣的:(reactnative could not get batchedbridge, make sure your bundle is packaged correctly)