【发布时间】:2025-12-27 08:30:14
【问题描述】:
我有一个使用“npx react-native init LatinApp”命令使用 React Native CLI 构建的全新应用程序,并且在任何文件中都没有进行任何编辑。 当我在 cmd 中运行“npx react-native run-android”命令时,它会在另一个 cmd 中打开 Metro,但会引发以下错误。 (我以管理员权限运行我的 cmd,并且 android 文件夹中的所有文件都启用了完全访问权限)
C:\Users\eminn\Desktop\projects\LatinApp>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 870 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
> Task :app:processDebugMainManifest FAILED
Error 'C:\Users\eminn\Desktop\projects\LatinApp\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: 4 executed, 7 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\eminn\Desktop\projects\LatinApp\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 22s
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\eminn\Desktop\projects\LatinApp\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 22s
at makeError (C:\Users\eminn\Desktop\projects\LatinApp\node_modules\execa\index.js:174:9)
at C:\Users\eminn\Desktop\projects\LatinApp\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (C:\Users\eminn\Desktop\projects\LatinApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\eminn\Desktop\projects\LatinApp\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
【问题讨论】:
-
能否添加 package.json?
-
你有反应原生环境的错误。首先添加 react 原生环境。
标签: android react-native gradle