React Native运行的时候,经常碰到React Native unable to load script from assets index.android.bundle on windows解决方法有2种:

方法一:设置IP和端口

具体步骤:报错页面晃动手机,显示菜单 =》 点击Dev Settings =》 点击Debug server host & port for device =》 设置IP和端口(ex:192.168.0.20:8081)=》 点击返回 =》 页面是空白,再次点击摇一摇,选择Reload JS程序就显示出来了。

如果这种方法还是不行继续往下看。

方法二:原因没有找到assets下文件,需要手动创建并设置

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;

到这就结束了,基本这2个方法就可以解决React Native unable to load script from assets 了。

解决React Native unable to load script from assets index.android.bundle on windows的更多相关文章

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

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

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

  3. 项目初始化以后出现: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日 ...

  4. unable to load script from assets 'index.android bundle'

    在Android手机上运行React-native项目时 报错:unable to load script from assets 'index.android bundle'  ,make sure ...

  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 you bundle is packaged correctly

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

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

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

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

  9. 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 ...

随机推荐

  1. C#实现谷歌翻译API

    由于谷歌翻译官方API是付费版本,本着免费和开源的精神,分享一下用C#实现谷歌翻译API的代码.这个代码非常简单,主要分两块:通过WebRequest的方式请求内容:获取Get方式的请求参数(难点在于 ...

  2. SDWebImage源码阅读-第三篇

    这一篇讲讲不常用的一些方法. 1 sd_setImageWithPreviousCachedImageWithURL: placeholderImage: options: progress: com ...

  3. 软件raid 5

    软件raid 5的实现 RAID 5 是一种存储性能.数据安全和存储成本兼顾的存储解决方案. RAID 5可以理解为是RAID 0和RAID 1的折中方案.RAID 5可以为系统提供数据安全保障,但保 ...

  4. 关于eclipse新建web项目,提示:"The superclass "javax.servlet.http.HttpServlet" was not found on the Java"解决办法

    新建jsp页面老提示: Multiple annotations found at this line: - The superclass "javax.servlet.http.HttpS ...

  5. CentOS6.8安装python2.7以及XX-Net

    xx-net在ubuntu上运行用起来很方便,如果有一些原因必须用CentOS,麻烦就比较大了. 首先需要升级python版本,CentOS自带的2.6版本是用不了的,必须升级到2.7以上,但是不能用 ...

  6. 自己积累写的winfrom 操作api 类

    引用 类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sys ...

  7. python爬虫之re正则表达式库

    python爬虫之re正则表达式库 正则表达式是用来简洁表达一组字符串的表达式. 编译:将符合正则表达式语法的字符串转换成正则表达式特征 操作符 说明 实例 . 表示任何单个字符 [ ] 字符集,对单 ...

  8. JavaScript函数认识,Js中的常见函数

    JavaScript函数: 也称为方法,用来存储一块代码,需要的时候调用. 函数是由事件驱动的或者当它被调用时执行的可重复使用的代码块. 函数需要包含四要素:返回类型,函数名,参数列表,函数体 拓展: ...

  9. nginx之 nginx + tomcat + redis 负载均衡且session一致性

    说明: 本文描述的是 nginx + tomcat + redis 实现应用负载均衡且满足session一致性,从安装到配置的全部过程,供大家学习!nginx 代理服务器ip: 10.219.24.2 ...

  10. jmeter 实现DB数据与接口数据的匹配校验

    前言:接口出参数据与DB数据结合校验,使校验力度更准确~ jmeter自带插件JDBC Request Sampler 这个Sampler可以向数据库发送一个jdbc请求(sql语句),并获取返回的数 ...