Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting error while creating release apk from react native with gradlew assembleRelease

i want to release the apk but im getting error -file already exists, mkdir 'D:\mobile'.its generating file nameed mobile in the d drive. after deleting the file , executing gradlew assembleRelease again creating this file and throwing error.

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

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

like image 669
krishna mohan Avatar asked Oct 20 '25 01:10

krishna mohan


1 Answers

In your scenario I think you haven't made a js bundle so please make a bundle first by using command

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

After that move in to your project's android directory using cd android

Before make release build make sure to clean your gradle using ./gradlew clean

And finally run this command ./gradlew assembleRelease -x bundleReleaseJsAndAssets

like image 169
Akila Devinda Avatar answered Oct 22 '25 04:10

Akila Devinda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!