Can
Be Better

React Native打包后运行闪退

React Native项目参照官方教程安卓打包后,手机安装会出现闪退,然而调试debug可以运行。排查了一下也没发现明显的错误,比如完善说的View不兼容之类的。然后看了几篇文章是说react-native的js没有打包进去也就是说少了index.android.bundle文件,这个文件在android/app/src/main/assets/目录下,如果没有这个文件并且打包闪退后可以执行:

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/

注意入口文件是index.js还是其他,按情况修改

赞(0) 打赏
不开启评论,如有问题疑问请发邮件。[email protected]最长的路 » React Native打包后运行闪退
分享到: 更多 (0)