Home > OS >  Fresh React Native App won't install on emulator when I run "npx react-native run-ad"
Fresh React Native App won't install on emulator when I run "npx react-native run-ad"

Time:11-25

I have a fresh app built with React Native CLI using the "npx react-native init LatinApp" command and there is nothing edited in any file. When I run the "npx react-native run-android" command in cmd, it opens Metro in another cmd but it throws the following error. (I ran my cmd with administrator privileges and all files inside the android folder have Full Access enabled)

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.

CodePudding user response:

The problem was with AVG Antivirus, it flagged the "manifest-merger-blame-debug-report.txt" as a Trojan for some reason. Disabled that and the build finished successfully.

  • Related