React Native真机红屏报错总结

版权声明:博文转载请注明来自:https://blog.csdn.net/piaobodewu https://blog.csdn.net/piaobodewu/article/details/83653900

一、run-android报错:unable to load script from assets 'index.android.bundl'

解决:

1.进入\android\app\src\main

2.新建assets文件夹

3.执行

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

二、run-android报错:Module HMRClient is not a registerd callable module

解决:

原因是ip变动引起的,用ipconfig查看ip后在Dev Setting里面设置的IP,格式ip:8081

三、run-android报错:The development server returned response error code: 500 in react-native

报500错误时,先考虑下。是不是正写着项目图片然报500错误了。如果是这样的话很有可能是因为文件或图片引入不成功,也就是引入路径错误导致的

猜你喜欢

转载自blog.csdn.net/piaobodewu/article/details/83653900