Javascript (反应本机):任务';的执行失败:应用程序:generatePackageList';

Javascript (反应本机):任务';的执行失败:应用程序:generatePackageList';,javascript,android,react-native,gradle,execution,Javascript,Android,React Native,Gradle,Execution,我正在生成我使用React Native开发的项目的apk。但是,当我运行命令/gradlew assembleerelease时,出现以下错误: > Configure project :react-native-audio WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed in version 5.0

我正在生成我使用React Native开发的项目的apk。但是,当我运行命令
/gradlew assembleerelease
时,出现以下错误:

> Configure project :react-native-audio
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

> Task :app:generatePackageList FAILED

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\romer\ProjetoAP\Gravador\teste\Gravador_de_audio\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 131

* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch

* 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 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 24s
1 actionable task: 1 executed
PS C:\users\romer\ProjetoAP\Gravador\teste\Gravador_de_audio\android>

如何解决这个问题?

我刚刚遇到了同样的问题,并且能够追踪到为什么它会发生在我的系统上。使用
--stacktrace
标志有助于了解发生了什么,最终指向
react native community/cli

在扫描了
react native community/cli
repo中的问题和PR之后,我发现了这个PR,它增加了对Gradle 7的支持

我在系统上安装了Gradle 7,并将其降级到Gradle 6,运行
Gradle包装器
,然后
/gradlew clean
允许我继续前进


希望这能解决您的问题,或者至少让您了解如何在您的系统中跟踪它

+1表示降级至6。我今天想做一些升级,但结果适得其反。

我设法解决了它!谢谢!:)Gradle不支持Java 16,Gradle的7.0版本除外。react native cli不支持Gradle 7.0。多么令人难以置信的一天:/