【发布时间】:2020-05-29 18:22:09
【问题描述】:
使用以下命令创建我的 React-Native 项目后:
npx react-native init AwesomeProject
当我想使用以下命令运行项目时
npx react-native run-android
我收到以下错误:
info 运行 jetifier 将库迁移到 AndroidX。你可以 使用“--no-jetifier”标志禁用它。
Jetifier 找到 864 个文件到 向前喷射。使用 8 个工人... info 正在启动 JS 服务器...
错误 ENOENT:没有这样的文件或目录,打开 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'。 使用 --verbose 标志运行 CLI 以获取更多详细信息。
错误:ENOENT:没有这样的 文件或目录,打开 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml' 在 Object.openSync (fs.js:456:3) 在 Object.readFileSync (fs.js:358:35) 在 getLaunchPackageName (C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\getLaunchPackageName.js:161:33) 在 buildAndRun (C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:163:63) 在 C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:135:12 在 processTicksAndRejections (internal/process/task_queues.js:97:5) 在异步 Command.handleAction (C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules\react-native\node_modules@react-native-community\cli\build\index.js:182:9)
我尝试卸载软件包并重新安装,但它不起作用。
编辑:
在 node_modules 文件夹中有一个名为 @react-native-community 的包, 当我使用我以前项目的@react-native-community 包并替换时,它工作得很好
我的 package.json
{
"name": "AwesomeProject",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.5"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
【问题讨论】:
标签: react-native react-native-android