美文网首页
reactnative unable to load scrip

reactnative unable to load scrip

作者: oc123 | 来源:发表于2018-05-07 15:51 被阅读0次

rn项目在运行Android模拟器,出现'unable to load script from assets 'index.android.bundle'.make sure your bundle is packaged correctly or ...'错误,解决办法;

第一步:

在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/

注意:上述entry-file index.js中index.js是android端的入口,某些版本的rn框架可能要用的是entry-file index.android.js

第三步:
react-native run-android

相关文章

网友评论

      本文标题:reactnative unable to load scrip

      本文链接:https://www.haomeiwen.com/subject/jycvrftx.html