【问题标题】:Unable to load script from assets 'index.android.bundle'.Make sur your Bundle is packaged correctly无法从资产“index.android.bundle”加载脚本。请确保您的 Bundle 已正确打包
【发布时间】:2018-07-24 10:31:25
【问题描述】:

当我运行 react-native run-android 时,应用程序会在我的设备中启动,但会出现以下错误

我已经尝试使用以下链接解决问题:

Unable to load script from assets 'index.android.bundle'.

Unable to load script from assets index.android.bundle on windows

但是,我的问题没有解决。在我尝试按照官方文档中的描述使用之前:Running On Device 没有什么对我有用,即使在重新启动运行 Windows 10 的电脑后也是如此

【问题讨论】:

  • 我认为您在不同的应用程序中运行打包程序
  • 不,我没有在不同的应用程序中运行打包程序
  • 您的移动设备和您的系统是否在同一个网络上?我可以看到您在设备中使用 LTE
  • 好的,你看到的LTE是移动热点与PC共享的无线连接,所以在同一个网络中
  • 我在某处读到问题可能来自 react-native 版本,我的是:0.56.0 所以我应该尝试降级到 0.55.4,因为最新的 haq 有一些错误

标签: react-native


【解决方案1】:

尝试退出 Node Packager CMD 并停止所有正在运行的 CMD。在以管理员身份运行时打开新的 CMD。从设备上卸载应用程序。再次转到您的项目文件夹并执行“react-native run-android”。

【讨论】:

  • 我已经按照你说的做了,现在我从E:\AgamesChristian\react-native\model\node_modules\react-native\Libraries\react-native\react-native-implementation.js得到了这个error: bundling failed: Error: Unable to resolve module AccessibilityInfo`:模块AccessibilityInfo在Haste模块地图中不存在`
  • 在上述错误下它给出了这个:This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following: 1. Clear watchman watches: watchman watch-del-all. 2. Delete the node_modules`文件夹:rm -rf node_modules && npm install。 3. 重置 Metro Bundler 缓存:rm -rf /tmp/metro-bundler-cache-*npm start -- --reset-cache。 4. 移除急速缓存:rm -rf /tmp/haste-map-react-native-packager-*.`
  • 试试 'npm cache clean --force'
  • 不总是渲染
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-12-01
  • 2018-07-11
  • 1970-01-01
  • 2020-11-13
  • 2017-11-10
相关资源
最近更新 更多