无法加载脚本.请确保您正在运行 Metro 服务器或您的包“index.android.bundle"已正确打包以供发布 [英] Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release

查看:48
本文介绍了无法加载脚本.请确保您正在运行 Metro 服务器或您的包“index.android.bundle"已正确打包以供发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

react-native run-android 命令通过在 android 模拟器中留下一条消息来终止.消息如下:

react-native run-android command terminates by leaving a message in android simulator. The message is as follows:

无法加载脚本.请确保您正在运行 Metro 服务器或您的包index.android.bundle"已正确打包以供发布.

Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release.

我做错了什么?

推荐答案

您还没有启动打包程序.在 react-native run-android 之前,在项目的根目录中运行 npm startreact-native start.

You haven't started the bundler yet. Run npm start or react-native start in the root directory of your project before react-native run-android.

这篇关于无法加载脚本.请确保您正在运行 Metro 服务器或您的包“index.android.bundle"已正确打包以供发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆