经常遇到这个问题,原因是没有找到assets下文件,用如下步骤可以解决,
注意,最新版本的react native 项目中没有index.android.js ,只有index.js需要将下面命令中的 index.android.js 替换为index.js即可。
备注:
react native:048版本之前,是有index.android.js ,但是0.48之后就没有了,只有index.js
1.首先手动在main下建立一个assets文件夹
2.然后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
3.在执行 react-native run-android 跑起来了
相关问题:
1.https://blog.csdn.net/yy11534/article/details/79608533
2.https://blog.csdn.net/sliverbullets/article/details/79447246
网友评论