Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Android build : Process 'command 'npx.cmd'' finished with non-zero exit value 1

Tags:

react-native

I keep getting this error when trying to generate the APK for my project. I use react native 0.61.5 and I don't install any library.

C:\Users\Ali\Desktop\Desktop\My work\ReactNative\AwesomeProject61\android>gradle
w bundleRelease

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, C:\Users\Ali\Desktop\Desktop\My
info Writing sourcemap output to:, C:\Users\Ali\Desktop\Desktop\My
info Done writing sourcemap output
info Done writing bundle output
info Copying 1 asset files
Error: EEXIST: file already exists, mkdir 'C:\Users\Ali\Desktop\Desktop\My'
error EEXIST: file already exists, mkdir 'C:\Users\Ali\Desktop\Desktop\My'. Run
CLI with --verbose flag for more details.

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.cmd'' finished with non-zero exit value 1

* 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 1m 14s
1 actionable task: 1 executed

C:\Users\Ali\Desktop\Desktop\My work\ReactNative\AwesomeProject61\android>
like image 509
Ali Zali Avatar asked Jan 11 '20 14:01

Ali Zali


3 Answers

Have you tried cleaning your Gradle?

Please try this command cd android && ./gradlew clean run this command on your project's root directory! or ./gradlew clean in your project's android folder.

after that recompile the App .

If the above solution does not help, try building your release with this command, go to your android folder and run command ./gradlew assembleRelease -x bundleReleaseJsAndAssets

like image 179
Kashan Haider Avatar answered Nov 01 '22 03:11

Kashan Haider


The following command works for me:

gradlew assembleRelease -x bundleReleaseJsAndAssets 
like image 5
MzkZeeshan Avatar answered Nov 01 '22 04:11

MzkZeeshan


Try to install Watchman

Then cd android && ./gradlew app:assembleRelease

like image 1
PrimulaX Avatar answered Nov 01 '22 04:11

PrimulaX