当前位置: 首页 > 知识库问答 >
问题:

如何解决Cordova项目中的“build.gradle”问题?

屠锦
2023-03-14
$ cordova build android --debug
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=E:\andoidSDK (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\projeler\ohsmobile\platforms\android\CordovaLib\build.gradle' line: 41

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> Failed to apply plugin [id 'com.github.dcendents.android-maven']
   > Configuration with name 'testImplementation' not found.

* 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

BUILD FAILED in 2s
> Configure project :CordovaLib

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings
C:\projeler\ohsmobile\platforms\android\gradlew: Command failed with exit code 1 Error output:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\projeler\ohsmobile\platforms\android\CordovaLib\build.gradle' line: 41

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> Failed to apply plugin [id 'com.github.dcendents.android-maven']
   > Configuration with name 'testImplementation' not found.

* 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

BUILD FAILED in 2s
[ERROR] An error occurred while running subprocess cordova.

        cordova build android --debug exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

共有3个答案

曹镜
2023-03-14

将您的系统语言更改为英语
此版本随Android Studio 3.3提供
如果您使用的是单语言操作系统,您可以按照
文件更改版本

柴宏阔
2023-03-14

建筑替换中的渐变文件

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
}

运行后:ionic cordova构建android--prod--释放

严瑞
2023-03-14

我变了

类路径'com.android.tools.build: gradle: 3.3.0'

classpath'com.Android工具。建造:渐变:3.0.1'

在 /platforms/android/build.gradle文件中。我的问题解决了。

 类似资料:
  • 目前我有应用程序是在谷歌播放,我有keystore和密码。当我尝试构建我的应用程序使用我工作正常,得到了未签名的apk.但当我尝试签署的应用程序它显示给我一个错误,你能帮我解决这个问题吗? 检测到Android Studio项目 子项目路径:CordovaLib子项目路径:app publishNonDefault已弃用,不再有效。所有变体现在都已发布。项目中的配置“编译”:app已弃用。改用“实

  • 本文向大家介绍如何解决项目中java heap space的问题,包括了如何解决项目中java heap space的问题的使用技巧和注意事项,需要的朋友参考一下 起因 17年的一个项目出了OOM(java heap space)问题,眼下有个问题:法院项目,不能外网,一连接外网高院会直接定位到计算机,发出警报(档案的机密性啊)不能远程,那只能视频教他们怎么做了,全程和一个文员说代码,真的很累==

  • 当我尝试运行应用程序时,它工作正常。但是当我构建签名apk时,出现了错误 失败:构建失败,出现异常。 问题:任务“:app:lintVitalRelease”的执行失败 无法解析配置“:image_picker_android:调试单元测试运行时类路径”的所有项目。无法转换 bcprov-jdk15on-1.68.jar (org.bouncycastle:bcprov-jdk15on:1.68)

  • 构建文件中有一个错误。我尝试了所有方法,但没有成功得到这个错误失败:构建失败,但有一个例外。 > 错误:评估项目“: app”时出现问题。 格式错误的\uxxxx编码。 > 尝试:使用--stacktrac选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--can运行以获得完整的见解。 在https://help.gradle.org获得更多帮助 运行Gra

  • 本周我收到了来自Google的安全警报,告诉我升级我的android版本的cordova应用程序。来自谷歌的电子邮件如下- 这是一个通知,表明您的应用程序ID是基于包含安全漏洞的Apache Cordova版本构建的。这包括一个高严重性跨应用程序脚本(XAS)漏洞。在某些情况下,易受攻击的应用程序可能被远程攻击以窃取敏感信息,例如用户登录凭据。 您应该尽快升级到Apache Cordova 3.5

  • 我已经尝试了在不同的包中添加类的各种可能的方法,比如在包com.packageName中添加应用程序类,在不同的包名model中添加控制器,当我试图执行程序时,它返回默认的白标签错误,当我将这些类放在同一个包中时,它成功地运行。 所以我想问是否有任何问题与项目或我需要给出任何路径。之前,我也尝试过表示组件扫描的符号,除了to之外,其他都没有用到