1

I'm trying to generate release version of my app using React-native. I ran ./gradlew assembleRelease it gave me this error:

AwesomeProject\android> ./gradlew assembleRelease

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
                 Welcome to React Native!
                Learn once, write anywhere


Failed to construct transformer:  Error: EPERM: operation not permitted, read
    at Object.readSync (fs.js:581:3)
    at tryReadSync (fs.js:357:20)
    at Object.readFileSync (fs.js:386:19)
    at Object.<anonymous> (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:220:39)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:78:24)
    at _next (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:98:9)
    at C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:103:7
    at new Promise (<anonymous>)
    at Object.<anonymous> (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:95:12) {
  type: 'Error',
  errno: -4048,
  syscall: 'read',
  code: 'EPERM'
}
error EPERM: operation not permitted, read. Run CLI with --verbose flag for more details.
Error: EPERM: operation not permitted, read
    at Object.readSync (fs.js:581:3)
    at tryReadSync (fs.js:357:20)
    at Object.readFileSync (fs.js:386:19)
    at Object.<anonymous> (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:220:39)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:78:24)
    at _next (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:98:9)
    at C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:103:7
    at new Promise (<anonymous>)
    at Object.<anonymous> (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\jest-haste-map\build\worker.js:95:12)

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command '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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 36s
56 actionable tasks: 2 executed, 54 up-to-date
PS C:\Users\Hamza Ahzam\Desktop\AwesomeProject\android> react-native bundle ...
Command `bundle` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.
PS C:\Users\Hamza Ahzam\Desktop\AwesomeProject\android> cd ..
PS C:\Users\Hamza Ahzam\Desktop\AwesomeProject> react-native bundle ...
error Option "--entry-file" is missing. Run CLI with --verbose flag for more details.
Error: Option "--entry-file" is missing
    at C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\react-native\node_modules\@react-native-community\cli\build\tools\assertRequiredOptions.js:51:13
    at Array.forEach (<anonymous>)
    at assertRequiredOptions (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\react-native\node_modules\@react-native-community\cli\build\tools\assertRequiredOptions.js:40:11)
    at Command.handleAction (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:181:42)
    at Command.listener (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\commander\index.js:315:8)
    at Command.emit (events.js:314:20)
    at Command.parseArgs (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\commander\index.js:651:12)
    at Command.parse (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\commander\index.js:474:21)
    at setupAndRun (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:267:24)
    at Object.run (C:\Users\Hamza Ahzam\Desktop\AwesomeProject\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:206:11

After Watching many solutions i Tried building APK through this command ./gradlew assembleRelease -x bundleReleaseJsAndAssets it was a success in building apk but when i ran it in my device it crashes

hamzaahzam
  • 306
  • 3
  • 14
  • 1
    Possible duplicate of [Fail to install npm package "npm ERR! errno -4048"](https://stackoverflow.com/questions/30860795/fail-to-install-npm-package-npm-err-errno-4048) - error code matches and NPM is involved in both questions. – karllindmark Jul 28 '20 at 22:14
  • Any way of solving this problem? – Ravis Farooq Dec 13 '22 at 09:51

1 Answers1

1

for APK build you can use this command- ./gradlew assembleRelease -x bundleReleaseJsAndAssets and for bundle release you can use -- ./gradlew bundleRelease -x bundleReleaseJsAndAssets

Rajesh Senapati
  • 201
  • 1
  • 8