首页 > 解决方案 > 构建 apk 时反应原生已弃用的 Gradle 功能

问题描述

我正在尝试使用构建我的 apk,./gradlew bundleRelease但我总是收到此错误:

error EISDIR: illegal operation on a directory, open 'P:\React'. Run CLI with --verbose flag for more details.
Error: EISDIR: illegal operation on a directory, open 'P:\React'

> 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

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.0.1/userguide/command_line_interface.html#sec:command_line_warnings

我也尝试过./gradlew app:assembleRelease,但我得到了同样的错误。我还使用 npx 创建了我的项目。

标签: androidreact-nativegradle

解决方案


我尝试了一切,我什至更新了项目 gradle 版本,但我仍然会得到同样的错误。但解决方案就是这样:

cd android

清理你的gradle:

./gradlew clean

然后:

./gradlew assembleRelease -x bundleReleaseJsAndAssets

推荐阅读