无法作为 app:processDebugMainManifest FAILED 启动 react-native

时间:2021-07-10 18:08:22

标签: android react-native android-studio gradle

我正在学习 Setting up the development environment 中的教程,配置 Windows 和 Android 的 React Native CLI 快速入门。

每当我在另一个 CMD 中运行命令 react-native run-android Metro 时,Android Studios 都会打开,但此错误出现在原始 CMD 中。

 info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:12644) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Jetifier found 896 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...

> Task :app:processDebugMainManifest FAILED
Error 'C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\outputs\logs\manifest-merger-debug-report.txt (Access is denied)' while writing the merger report file, build can continue but merging activities will not be documented
11 actionable tasks: 2 executed, 9 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

    at makeError (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\execa\index.js:174:9)
    at C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
    at async Command.handleAction (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.

我使用 this postthe answer 作为参考,因为我认为它们很相似,但我之前得到的错误却与此相似。

> Task :app:processDebugMainManifest FAILED
Error 'C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\outputs\logs\manifest-merger-debug-report.txt (Access is denied)' while writing the merger report file, build can continue but merging activities will not be documented

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
11 actionable tasks: 2 executed, 9 up-to-date

我还想说我已经运行了命令 gradlew clean 和同样的错误。

gradlew.bat 有什么问题吗?

1 个答案:

答案 0 :(得分:0)

它提到了 access denied,尝试更改对 android 文件夹的权限并查看。