博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[reactNative]unable to load script from assets ‘index.android.bundle’
阅读量:4227 次
发布时间:2019-05-26

本文共 645 字,大约阅读时间需要 2 分钟。

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

0x0001 产生原因,缺少bundle,为啥缺少,不知道。

0x0002 解决:
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/

然后重新运行: react-native run-android

NOTE:总结:

index.android.bundle是用来调用原生控件的js脚本,每次当改变了 index.android.js,都需要使用上面的代码片段,来及时的更新index.android.bundle,然后打包才可以把新的index.android.js应用上,所以当没有index.android.bundle文件时,React-Native 项目是无法运行的。

转载地址:http://gdcqi.baihongyu.com/

你可能感兴趣的文章
Blizzard的MPQ文件格式搜索算法
查看>>
考场安排---图的着色原理之运用 (转载)
查看>>
对.lds连接脚本文件的分析
查看>>
通过内核源码看函数调用之前世今生(转载)
查看>>
你的变量究竟存储在什么地方?
查看>>
s3c2410 中断异常处理(转)
查看>>
对张孝祥C语言试题其中一题的探讨 (转载)
查看>>
一些好的网站
查看>>
map.txt
查看>>
volatile关键字
查看>>
ZLG7290键盘驱动开发心得
查看>>
WinCE中的虚拟地址和实际的物理地址是如何对应
查看>>
Microsoft Windows CE 的内存使用
查看>>
makefile入门
查看>>
中科院计算所Goddon CPU诞生历史!牛!
查看>>
ispPAC
查看>>
迷你型的 Linux 系统
查看>>
为人处世小技巧
查看>>
C++ 堆、栈及静态数据区详解
查看>>
VC++6.0编译环境介绍
查看>>