如何修复"build.gradle" Cordova项目中的问题? [英] How to fix "build.gradle" problem in a Cordova project?

查看:470
本文介绍了如何修复"build.gradle" Cordova项目中的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ 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.

推荐答案

我更改了

classpath'com.android.tools.build:gradle:3.3.0'

classpath 'com.android.tools.build:gradle:3.3.0'

classpath'com.android.tools.build:gradle:3.0.1'

classpath 'com.android.tools.build:gradle:3.0.1'

在/platforms/android/build.gradle文件中的

.我的问题解决了.

in /platforms/android/build.gradle file. My problem is solved.

这篇关于如何修复"build.gradle" Cordova项目中的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆