Unable to load script from assets 'index.android.bundle'.解决方案
来源:互联网 发布:知喻经济发展讲座 编辑:程序博客网 时间:2024/05/29 12:23
刚接触React Native,新建了一个项目,在Android Studio的模拟器上可以运行,但用Genymotion模拟器运行时却报如下错误:
上网查了一下,很多文章都提出下面的解决方法:
1.首先手动在android/app/src/main目录下建立一个assets文件夹
2.然后在项目的根目录下执行
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看是否能运行成功
我按照上面的步骤执行后,项目依然报一样的错误,后来请教了一位前辈,可以试试将此模拟器关闭并删除,然后重新添加并启动,我照做后,再次运行果然就能跑起来了。
删除跟添加按钮如下图:
那位前辈告诉我,在Android Studio的模拟器上能跑起来,应该在Genymotion模拟器上也能跑起来,他也偶尔会遇见通过重启模拟器来解决掉一些无理的问题的情况。
总之,可能如果一开始就重启,或许就不需要新建assets文件夹那几步了吧,各位要是也遇到这问题就都试试吧。
阅读全文
0 0
- Unable to load script from assets 'index.android.bundle'.解决方案
- unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correct
- React-Native Android真机测试 -unable to load script from assets 'index.android bundle'...
- React Native unable to load script from assets index.android.bundle on windows
- React Native for Android Nnable to load script from assets 'index.android bundle'
- rn笔记:(Genymotion)启动rn时,node没启动成功,导致报错unable to load script from assets'index.android.bundle'
- react-native---配置reactnative报红,run-Android时候报错unable to load script from assets 'index.android.bundl
- [ReactNative]Unable to load script form assets
- React Native之unable to load script from assets解决 on windows
- react-native 最新版本爬坑经历(unable to load script from assets 和could not connect to development server.)
- react native 错误unable to load script form assets解决
- react native 错误unable to load script form assets解决
- react native unable to load script form assets 错误解决
- XML Unable to load embedded resource from assembly解决方案
- Android emulator: ERROR: Unable to load VM from snapshot.
- Android Studio-emulator: ERROR: Unable to load VM from snapshot.
- Unable to load configuration解决方案
- Unable to download JS bundle 解决方案
- 使用spring管理数据库的链接,总是连接超时com.mchange.v2.resourcepool.TimeoutException
- 添加服务到开机自动启动(centos7开机自启动nginx,php-fpm)
- 浏览器兼容
- 杭电oj2564
- JSP环境及其第一个动态网页
- Unable to load script from assets 'index.android.bundle'.解决方案
- 点击侧滑任何一个 菜单项,请求网络数据展示在主界面的xlistview中且实现下拉刷新效果和上拉加载的分页加载数据效果
- python中continue语句与break语句的区别
- Storm 编程模型 核心组件 Stream Grouping 数据分组策略
- Spring注入
- Android Animation(动画)介绍
- 常见的浏览器兼容问题
- CCF CSP 公共钥匙盒 JAVA 201709-2 100分
- 动态规划--最大和子序列