gpt4 book ai didi

cordova - ionic android 构建失败 'CordovaLib'

转载 作者:行者123 更新时间:2023-12-05 06:34:19 28 4
gpt4 key购买 nike

我到处搜索,没有关于此错误的信息。我有android studio,尝试了几个sdk,同样的错误。环境变量也设置妥当。

顺便说一句,这是 build.gradle 的第 40 行,应用插件:'com.android.library'

FAILURE: Build failed with an exception.

  • Where: Build file '/home/user/Documents/app/platforms/android/CordovaLib/build.gradle' line: 40
A problem occurred evaluating project ':CordovaLib'.
org.gradle.api.Project.getPluginManager()Lorg/gradle/api/plugins/PluginManager;

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (/home/user/app/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:947:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
(node:2259) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2259) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

最佳答案

对于那些遇到此错误的人,它与您的 gradle 配置有关。我已经通过包管理器安装了 gradle,它安装了一个旧版本,我认为这很好。至少需要 v4.1 的 gradle 才能与最新的 cordova 和 android 正常工作。

确保从他们的网站安装最新的 gradle:https://gradle.org/install/#manually

正确设置你的 gradle 路径:$ export PATH=$PATH:/gradle_install_loc/gradle-4.7/bin

还要确保您在 .properties.gradle 文件中运行正确的 gradle 版本项目文件夹:

/app_name/platforms/android/gradle/wrapper/gradle-wrapper.properties

关于cordova - ionic android 构建失败 'CordovaLib',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50318893/

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