gpt4 book ai didi

javascript - 找不到入口文件 index.js - React Native

转载 作者:行者123 更新时间:2023-11-30 00:12:52 27 4
gpt4 key购买 nike

我有基本的 React Native 应用程序。我正在尝试在虚拟 Android 设备中对其进行测试。我正在导航到该项目并键入 npm start -- --reset-cache。我终止进程并输入 react-native run-android。我有 Activity 的 Android 设备,但我在上面看到这个错误:

The development server returned response error code: 404 URL: http://10.0.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false Body... "Cannot find entry file index.js in any of the roots:[\"c:\\projects\\HelloRN]"....

我在项目的根目录中有 index.js。 Metro Bundler 在端口 8081 上运行,但我从中看到了同样的错误。我正在使用 React Native 0.51.0

最佳答案

有两种可能的解决方案:

  1. index.js 文件不在项目根目录
  2. react-native,在某些情况下,无法读取 index.js 因为试图找到 index.ios.js 和 index.android.js,所以,复制 index.js 并重命名为 index.android 和 index.ios .js

关于javascript - 找不到入口文件 index.js - React Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47876155/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com