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



解决这个问题的方案是:

进入你该项目的根目录下的 android目录下的app目录下的src文件下的mian文件,(可能说的有点绕),在main件夹下,创建一个assets文件,这个文件是rn的资源文件夹!

之后用dos进入你的项目根目录,执行一下命令:

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

命令执行成功后返回如下:

好,那接下来就可以在做运行你的命令了,react-native run-android

现在上述问题解决了,但是新问题又出现了,log控制台没有弹出来,所以接下来就会去找这个问题的答案,如果你遇到同样的问题,如果你已经找到了答案,欢迎分享!

react native中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. unable to load script from assets 'index.android bundle'

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

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

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

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

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

    报错: 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. 了解fortran语言

    最近看了一些文献,发现用了Fortran语言编程,并且还是近几年的,了解了之后才知道,其实Fortran已经慢慢没有人再用了,之所有还有一批人在用,极大可能是历史遗留问题吧.而这,也得从Fortran ...

  2. 转:QTCreater调试时提示ptrace不允许的操作(点击调试之后40秒钟gdb无回应)

    1. 问题描述 用QTCreater建立了一个纯C++的项目,但是在F5调试时,竟然提示ptrace不允许的操作,修改工程配置为Debug也不管用,经过网上搜索,原来还需要修改一下系统ptrace的配 ...

  3. JavaSE-异常

    1.try catch finally 异常捕获 public class ExceptionTest { public static void main(String[] args) { int a ...

  4. Java总结:语法基础

    更新时间:2018-1-7 10:34:05 更多请查看在线文集:http://android.52fhy.com/java/index.html Hello World 文件名:HelloWorld ...

  5. [Python 从入门到放弃] 3. BIF(内建函数)

    BIF (built-in functions) Python中提供了70多个内建函数,具备大量的现成功能. BIF不需要专门导入,可以直接使用,拿来就用 1.print() # 在屏幕上打印输出 如 ...

  6. pipelinedb--流、滑动窗口测试

    https://blog.csdn.net/liuxiangke0210/article/details/74010951 https://yq.aliyun.com/articles/166 一.p ...

  7. 一行一行读Java源码——LinkedBlockingQueue

    1.LinkedBlockingQueue概述 Linked:链表+Blocking:阻塞+Queue:队列 Queue:首先想到的是FIFO Linked:,Queue:其结构本质上是线性表,可以有 ...

  8. PTA (Advanced Level) 1004 Counting Leaves

    Counting Leaves A family hierarchy is usually presented by a pedigree tree. Your job is to count tho ...

  9. 自我总结 (三) --(Java Web学习)

    自我完善的过程就是在不断的自我总结不断的改进. 在前的近半个月里,我们经过了考试,也开始了java web的项目. 先看看这次的考试.考完之后我就觉得有点不对劲的,结果 结果真的是一塌糊涂.上周五的时 ...

  10. 控制器中获取Field值

    在ASP.NET MVC程序中,我们需要POST Data到制器中,是有很多方法.但是我们想在控制器中,获取Feild值呢?怎样获取?你可以留意到有一个类FormCollection.它能帮助到我们解 ...