任务':app:bundleReleaseJsAndAssets'的执行失败

时间:2020-07-28 21:43:43

标签: android react-native gradle

我正在尝试使用React-native生成我的应用程序的发行版。 我运行了./gradlew assembleRelease它给了我这个错误:

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

观看了许多解决方案之后,我尝试通过此命令来构建APK。/gradlewassembleRelease -x bundleReleaseJsAndAssets成功构建了apk,但是当我在设备中运行该应用时,它崩溃了

0 个答案:

没有答案
相关问题