首页 > 解决方案 > 任务 :app:generateBundledResourcesHashRelease 在构建 relese apk react-native 时失败

问题描述

安装 react-native-code-push 后我遇到了这个错误。

Task :app:generateBundledResourcesHashRelease FAILED
internal/fs/utils.js:230
    throw err;
    ^

Error: ENOENT: no such file or directory, scandir '/home/ayush/Desktop/awsproject/android/app/build/generated/res/react/release'
    at Object.readdirSync (fs.js:872:3)
    at getFilesInFolder (/home/ayush/Desktop/awsproject/node_modules/react-native-code-push/scripts/getFilesInFolder.js:7:26)
    at Object.<anonymous> (/home/ayush/Desktop/awsproject/node_modules/react-native-code-push/scripts/generateBundledResourcesHash.js:38:1)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/home/ayush/Desktop/awsproject/android/app/build/generated/res/react/release'
}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateBundledResourcesHashRelease'.
> Process 'command 'node'' 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.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 36s
52 actionable tasks: 52 executed

标签: react-native

解决方案


推荐阅读