gpt4 book ai didi

android - React Native 构建在 android 中失败,@react-native-community/cli-platform-android/native_modules.gradle' 行 : 130

转载 作者:行者123 更新时间:2023-12-03 13:37:26 39 4
gpt4 key购买 nike

我已将我的 ReactNative 项目从 0.59 升级到 0.61.2 iOS 构建正常,但在 Android 中我面临 @react-native-community/cli-platform 中的问题-android模块。

我的settings.gradle文件

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

我的build.gradle文件

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

构建应用程序时出现以下错误。

> Task :app:generatePackageList FAILED

FAILURE: Build failed with an exception.

* Where:
Script '/Users/yashwanth_c/Documents/projects/MobileApp/node_modules/@react-native-community/cli-platform-android
/native_modules.gradle' line: 130

* What went wrong:
Execution failed for task ':app:generatePackageList'.
> ReactNativeModules$_generatePackagesFile_closure3

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

BUILD FAILED in 5m 21s
4 actionable tasks: 4 executed

一如既往,我清理了缓存并删除了node_module文件夹,尝试了很多次但没有成功。也在谷歌上搜索了一个多星期,但仍然找不到解决办法,任何建议都表示赞赏。

最佳答案

我遇到了同样的问题,然后我尝试了下面的命令。这对我有用。意思是,手动安装android cli包。

npm i @react-native-community/cli-platform-android

如果有人知道其他解决方案,请在此处分享。

关于android - React Native 构建在 android 中失败,@react-native-community/cli-platform-android/native_modules.gradle' 行 : 130,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59422584/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com