首页 > 解决方案 > React Native Android build:进程'command'npx.cmd''以非零退出值1完成

问题描述

尝试为我的项目生成 APK 时,我不断收到此错误。我使用 react native 0.61.5 并且我没有安装任何库。

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>

标签: react-native

解决方案


你试过清理你的 Gradle 吗?

请尝试此cd android && ./gradlew clean 命令 在项目的根目录上运行此命令!或./gradlew clean在您项目的 android 文件夹中。

之后重新编译 App 。

如果上述解决方案没有帮助,请尝试使用此命令构建您的版本,转到您的 android 文件夹并运行命令./gradlew assembleRelease -x bundleReleaseJsAndAssets


推荐阅读