React Native-没有这样的文件或目录,打开'app \ build \ intermediates \ merged_manifests \ debug \ AndroidManifest.xml'

问题描述 投票:1回答:2

我正在使用React Native 0.61.5,安装@ react-native-community / cli并运行react-native run-android后,出现此问题:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
error ENOENT: no such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'. Run CLI with --verbose flag for more details.
Error: ENOENT: no such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'
    at Object.openSync (fs.js:440:3)
    at Object.readFileSync (fs.js:342:35)
    at getLaunchPackageName (C:\Users\Gabriel\Desktop\testeProjeto\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\getLaunchPackageName.js:161:33)
    at buildAndRun (C:\Users\Gabriel\Desktop\testeProjeto\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:163:63)
    at C:\Users\Gabriel\Desktop\testeProjeto\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:135:12
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at async Command.handleAction (C:\Users\Gabriel\Desktop\testeProjeto\node_modules\@react-native-community\cli\build\index.js:182:9)
react-native npm react-native-android node-modules react-native-ios
2个回答
0
投票

作为此answer says

[@ react-native-community / cli-platform-android 3.1.1的最新版本似乎存在问题。

我已通过将其添加到package.json来降级到该库的较旧版本,从而解决了我的问题。

"resolutions": {
    "@react-native-community/cli-platform-android": "2.9.0"
}

此后,删除node_modules文件夹,然后再次运行yarnnpm install


0
投票

我发现对我有用的唯一方法是遵循Github的建议:https://github.com/react-native-community/cli/issues/967

解决方案是在我的package.json文件中的依赖项中添加“ @ react-native-community / cli-platform-android”:“ 3.0.3”。

© www.soinside.com 2019 - 2024. All rights reserved.