编译APK时反应本机不推荐使用的Gradle功能

时间:2020-05-31 11:41:58

标签: android react-native gradle

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

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创建了我的项目。

1 个答案:

答案 0 :(得分:1)

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

cd android

清理gradle:

./gradlew clean

然后:

./gradlew assembleRelease -x bundleReleaseJsAndAssets