【问题标题】:error ENOENT: no such file or directory, open 'app/src/main/AndroidManifest.xml'错误 ENOENT:没有这样的文件或目录,打开 'app/src/main/AndroidManifest.xml'
【发布时间】:2019-11-03 03:56:50
【问题描述】:

我确实运行程序 react-native 以使用代码 react-native run-android 和 npm start 但程序错误文件 AndroidManifest,如果有文件。

错误 ENOENT:没有这样的文件或目录,打开 'app/src/main/AndroidManifest.xml' 包.json

    {
  "name": "react-native-inappbrowser-reborn",
  "version": "2.0.4",
  "description": "InAppBrowser for React Native",
  "main": "index.js",
  "readmeFilename": "README.md",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
    "start": "index.js",
  },
  "typings": "./index.d.ts",
  "repository": {
    "type": "git",
    "url": "git@github.com:proyecto26/react-native-inappbrowser.git"
  },
  "bugs": {
    "url": "https://github.com/proyecto26/react-native-inappbrowser/issues"
  },
  "keywords": [
    "react-native",
    "in",
    "app",
    "browser",
    "inappbrowser",
    "in-app-browser"
  ],
  "author": "Juan David Nicholls Cardona",
  "homepage": "https://github.com/proyecto26/react-native-inappbrowser",
  "license": "MIT",
  "peerDependencies": {
    "react-native": ">=0.55.0"
  },
  "dependencies": {
    "invariant": "^2.2.4",
    "react-native": "^0.59.9"
  },
  "devDependencies": {
    "babel-core": "^6.26.0",
    "flow-bin": "^0.80.0"
  }
}

向上数据

This error is caused by `hasteImpl` returning the same name for different files.
    at setModule (F:\react-hr-and-ess\node_modules\metro\node_modules\jest-haste-map\build\index.js:569:17)
    at workerReply (F:\react-hr-and-ess\node_modules\metro\node_modules\jest-haste-map\build\index.js:641:9)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:16876) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

enter image description hereenter image description here

【问题讨论】:

    标签: android node.js react-native npm


    【解决方案1】:
    1. (在项目目录中)mkdir android/app/src/main/assets
    2. react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/ app/src/main/res
    3. react-native run-android

    "test": "echo \"Error: no test specified\" && exit 1",后加逗号

    删除"start": "index.js"之后的逗号

     "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "start": "index.js"
      },
    

    正确的 json

        {
      "name": "react-native-inappbrowser-reborn",
      "version": "2.0.4",
      "description": "InAppBrowser for React Native",
      "main": "index.js",
      "readmeFilename": "README.md",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "start": "index.js"
      },
      "typings": "./index.d.ts",
      "repository": {
        "type": "git",
        "url": "git@github.com:proyecto26/react-native-inappbrowser.git"
      },
      "bugs": {
        "url": "https://github.com/proyecto26/react-native-inappbrowser/issues"
      },
      "keywords": [
        "react-native",
        "in",
        "app",
        "browser",
        "inappbrowser",
        "in-app-browser"
      ],
      "author": "Juan David Nicholls Cardona",
      "homepage": "https://github.com/proyecto26/react-native-inappbrowser",
      "license": "MIT",
      "peerDependencies": {
        "react-native": ">=0.55.0"
      },
      "dependencies": {
        "invariant": "^2.2.4",
        "react-native": "^0.59.9"
      },
      "devDependencies": {
        "babel-core": "^6.26.0",
        "flow-bin": "^0.80.0"
      }
    }
    

    【讨论】:

    • error JSON 错误在 F:\react-hr-and-ess\package.json: 解析 '{ "name": "react-native-inappbrowser-r 时 JSON 中位置 252 的意外字符串'. 使用 --verbose 标志运行 CLI 以获取更多详细信息。, 编辑 ?? thx
    • 如何使用 --help 命令,它返回什么?我更新我的答案
    • 我不知道,没有我的项目
    【解决方案2】:

    感谢这也帮助了我。入口点对于这个解决方案很重要,如果有人像我一样 jr

    这也可能有帮助。 enter link description here

    我的问题源于我安装 qs.js 并在安装过程中从我的 git bash 窗口将其停止(我是从我的 $path 以用户身份登录的,而不是明确的管理员) 我最终也做了 react-native-clean-project ,这对这个特定问题没有帮助

    不是:Win 10、Android 模拟器、React-Native-Debugger 0.10.1

    【讨论】:

    • 好吧,我把它拿回来了,它没用,已经踢了这个并在博览会上尝试了
    猜你喜欢
    • 2020-04-26
    • 1970-01-01
    • 2019-06-24
    • 2018-06-09
    • 1970-01-01
    • 2018-07-06
    • 1970-01-01
    • 2019-01-26
    • 2021-06-08
    相关资源
    最近更新 更多