'Getting error in react native : Task :app:processDebugMainManifest FAILED

error in new build :

Task :app:processDebugMainManifest FAILED Error 'D:\projects\react\New folder\new\awesome\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: 11 executed

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugMainManifest'.

java.io.FileNotFoundException: D:\projects\react\New folder\new\awesome\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 54s

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



Solution 1:[1]

make sure installed HAXM (for intel) or Hypervisor (for amd) on sdk tools you need a start first npx react-native start code in powershell (c:\yourusarname\yourprojectname) after open new powershell and npx react-native run-android (or ios)

Solution 2:[2]

you will need to add org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED to ./android/gradle.properties file in your project

it works like magic

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ahmet DADAGI
Solution 2 AREMU