Android手机上运行React-native项目时

报错:unable to load script from assets 'index.android bundle'  ,make sure your bundle is packaged correctly or youu're runing a packager server

解决方案:

第一步:在  android/app/src/main 目录下创建一个  assets空文件夹

第二步:执行 下面这段命令

  1. 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/

会发现 assets文件夹下多出两个文件

第三步:重新run程序。

总结:

这个index.android.bundle毫无疑问就是用来调用原生控件的js脚本,每次当你改变了 index.android.js,你都需要使用上面的代码片段,来及时的更新index.android.bundle,然后打包才可以把新的index.android.js应用上,所以当没有index.android.bundle文件时,RN是无法运行的.

see:  http://blog.csdn.net/u014175342/article/details/73823904

unable to load script from assets 'index.android bundle'的更多相关文章

  1. 解决React Native unable to load script from assets index.android.bundle on windows

    React Native运行的时候,经常碰到React Native unable to load script from assets index.android.bundle on windows ...

  2. 项目初始化以后出现:Unable to load script from assets 'index.android.bundle

    Mac中真机测试React Native project时出现Unable to load script from assets 'index.android.bundle' 2018年01月21日 ...

  3. react native中Unable to load script from assets 'index.android.bundle'解决方案

    刚刚朋友问我,说是创建好一个项目,运行后报错:Unable to load script from assets 'index.android.bundle',以前好好的没出现这种现象,于是我找到一个 ...

  4. Unable to load script from assets 'index.android.bundle'.make sure you bundle is packaged correctly

    解决此问题 以下方法每次都需要执行命令2才能更新 1.创建assets目录 mkdir android/app/src/main/assets 2.执行命令 react-native bundle - ...

  5. Unable to load script from assets 'index.android.bundle' 出错?

    野路子太多,坑人真的!F**k 言归正传,当你运行 react native 程序的时候出现这个错误 ,如果您使用Windows,请按以下方式运行命令,或者如果出现错误“无法找到条目文件index.a ...

  6. Unable to load script from assets 'index.android.bundle'.Make sure your bundle is packaged correctly or you're running a packager server

    curl -k 'http://localhost:8081/index.android.bundle?platform=android' > android/app/src/main/asse ...

  7. React Native: unable to load scripts from assets 'index.android.bundle' on real device

    问题:重新建了一个项目后,运行react-native run-android报: unable to load scripts from assets 'index.android.bundle' ...

  8. react-native 新手爬坑经历(unable to load script from assets 和could not connect to development server.)

    按照https://reactnative.cn/docs/0.51/getting-started.html教程新建的项目 react-native init AwesomeProject cd A ...

  9. React Native踩坑之Unable to load script from assets

    报错: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged corr ...

随机推荐

  1. Chisel3 - util - RRArbiter

    https://mp.weixin.qq.com/s/GcNIFkHfa0gW0HKkKvHZEQ     循环优先级(Round Robin)仲裁器.   参考链接: https://github. ...

  2. 曹工说Spring Boot源码(29)-- Spring 解决循环依赖为什么使用三级缓存,而不是二级缓存

    写在前面的话 相关背景及资源: 曹工说Spring Boot源码(1)-- Bean Definition到底是什么,附spring思维导图分享 曹工说Spring Boot源码(2)-- Bean ...

  3. IntelliJ IDEA连接不上数据库 (Connection to testdb@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.)

    问题提示为: 原因:MySQL数据库版本为8.0以上,需要在URL加上时区,即加上?serverTimezone=GMT 成功后为:

  4. Java实现 LeetCode 289 生命游戏

    289. 生命游戏 根据百度百科,生命游戏,简称为生命,是英国数学家约翰·何顿·康威在1970年发明的细胞自动机. 给定一个包含 m × n 个格子的面板,每一个格子都可以看成是一个细胞.每个细胞具有 ...

  5. java实现第五届蓝桥杯排列序数

    排列序数 如果用a b c d这4个字母组成一个串,有4!=24种,如果把它们排个序,每个串都对应一个序号: abcd 0 abdc 1 acbd 2 acdb 3 adbc 4 adcb 5 bac ...

  6. 使用macaca抓页面元素,执行命令后报安装失败处理Error: Command failed: ……pm install -r "/data/local/tmp/com.macaca.android.testing"

    最近换了小米手机做自动化测试,执行命令的时候报安装失败错误,错误如下 解决:设置小米允许USB安装就好了 pm install -r "/data/local/tmp/com.macaca. ...

  7. hadoop启动后,9000端口无法连接,netstat -tpnl中找不到该端口

    已解决: 需要重新格式化hdfs. 1.停止hdfs: 2.删除hdfs的相关文件目录(hdfs-site.xml中配置的存放文件的目录). 3.启动journalnode:sbin/hadoop-d ...

  8. 【JAVA习题三十】求0—7所能组成的奇数个数

    package erase; public class 求0到7所能组成的奇数个数 { public static void main(String[] args) { /* * 求0—7所能组成的奇 ...

  9. 温故知新-Mysql锁&事务&MVCC

    文章目录 锁概述 锁分类 MyISAM 表锁 InnoDB 行锁 事务及其ACID属性 InnoDB 的行锁模式 注意 MVCC InnoDB 中的 MVCC 参考 你的鼓励也是我创作的动力 Post ...

  10. Java 多线程基础(三) start() 和 run()

    Java 多线程基础(三) start() 和 run() 通过之前的学习可以看到,创建多线程过程中,最常用的便是 Thread 类中的 start() 方法和线程类的 run() 方法.两个方法都包 ...