刚刚朋友问我,说是创建好一个项目,运行后报错: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. windows线程退出的方法

    线程的handle用处: 线程的handle是指向“线程的内核对象”的,而不是指向线程本身.每个内核对象只是内核分配的一个内存块,并且只能由内核访问.该内存块是一种数据结构,它的成员负责维护对象的各种 ...

  2. 装饰者模式——Java设计模式

    装饰模式 1.概念 动态地为对象附加上额外的职责 其目的是包装一个对象,从而可以在运行时动态添加新的职责.每个装饰器都可以包装另一个装饰器,这样理论上来说可以对目标对象进行无限次的装饰. 2.装饰器类 ...

  3. 面试:用快排实现数组中的第K大的数

    #include <iostream> #include <cassert> using namespace std; int selectKth(int a[],int st ...

  4. 【详解】JNI (Java Native Interface) (三)

    案例三:C代码访问Java对象的实例变量   获取对象的实例变量的步骤: 1. 通过GetObjectClass()方法获得此对象的类引用 2. 通过类引用的GetFieldID()方法获得实例变量的 ...

  5. ActiveMQ Pub/Sub版的HelloWorld

    1. pom.xml 这个和上一篇是一样的: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=&qu ...

  6. UVa 1572 Self-Assembly (拓扑排序)

    题目链接: https://cn.vjudge.net/problem/UVA-1572 Automatic Chemical Manufacturing is experimenting with ...

  7. Webhook是什么、怎么理解

    Webhook是什么 我们想看看维基老大的解说: A webhook in web development is a method of augmenting or altering the beha ...

  8. jQuery.Ajax()执行WCF Service的方法

    Insus.NET有在上一篇<ASP.NET MVC呼叫WCF Service的方法>http://www.cnblogs.com/insus/p/3720547.html 直接呼叫WCF ...

  9. SQL语句大全从基础到熟练(不含数据库高端操作)日常用户 三、

    前言 昨天晚上回家忘记带钥匙导致在楼下站街三小时,鬼天气热的不要不要的然后我就在车里坐了会之后就.....zzZZ,哈哈睡的挺香的毕竟累了一天了 上两篇文章都是介绍的语法语句,本篇文章介绍下函数的使用 ...

  10. 使用Docker调试Asp.Net Core

    使用 Docker 进行部署 目前还是使用将发布出来的文件打包进docker镜像的形式 $ docker build -t pims . $ docker run --name pims --rm - ...