react-native用模拟器或安卓设备debug报错:unable to load script from assets 'index.android.bundle'
网上有许多说法,我也看了一下,总结的原因主要是,模拟器或设备无法连到npm service。
在安卓机上debug
如果你是在安卓机上debug那么你应该确保,你和你的电脑上跑的npm service在同一个网络下面,
最好是你的设备连的是你电脑上的WiFi。npm service就是下面这个

在模拟器设备上比如genymotion
你要按照这个链接确保你的模拟器的网络可用。然后重新运行一下你的code(react-native run-android)。
网友评论