corbova build android时gradle错误

本文介绍了一种常见的Gradle构建失败问题,即无法解析特定版本的Gradle插件依赖,并提供了手动修改build.gradle文件来替换依赖源的具体解决方案。

[INF] [shellscript] 

[INF] [shellscript] FAILURE: Build failed with an exception.

[INF] [shellscript] 

[INF] [shellscript] * What went wrong:

[INF] [shellscript] A problem occurred configuring root project '''android'''.

[INF] [shellscript] > Could not resolve all dependencies for configuration ''':_debugApk'''.

[INF] [shellscript]    > A problem occurred configuring project ''':CordovaLib'''.

[INF] [shellscript]       > Could not resolve all dependencies for configuration ''':CordovaLib:classpath'''.

[INF] [shellscript]          > Could not find com.android.tools.build:gradle:2.2.2.

[INF] [shellscript]            Searched in the following locations:

[INF] [shellscript]                https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom

[INF] [shellscript]                https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.jar

[INF] [shellscript]            Required by:

[INF] [shellscript]                android:CordovaLib:unspecified

[INF] [shellscript] 

[INF] [shellscript] * Try:

[INF] [shellscript] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

[INF] [shellscript] 

[INF] [shellscript] BUILD FAILED

[INF] [shellscript] 

[INF] [shellscript] Total time: 4.64 secs

[INF] [shellscript] Error: /Users/xxxxxx/Documents/GitWorkspaces/xxxxxx-app/cordova/platforms/android/gradlew: Command failed with exit code 1 Error output:

[INF] [shellscript] FAILURE: Build failed with an exception.

[INF] [shellscript] 

[INF] [shellscript] * What went wrong:

[INF] [shellscript] A problem occurred configuring root project '''android'''.

[INF] [shellscript] > Could not resolve all dependencies for configuration ''':_debugApk'''.

[INF] [shellscript]    > A problem occurred configuring project ''':CordovaLib'''.

[INF] [shellscript]       > Could not resolve all dependencies for configuration ''':CordovaLib:classpath'''.

[INF] [shellscript]          > Could not find com.android.tools.build:gradle:2.2.2.

[INF] [shellscript]            Searched in the following locations:

[INF] [shellscript]                https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom

[INF] [shellscript]                https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.jar

[INF] [shellscript]            Required by:

[INF] [shellscript]                android:CordovaLib:unspecified

[INF] [shellscript] 

[INF] [shellscript] * Try:

[INF] [shellscript] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


手工修改

\platforms\android目录 和 \platforms\android\CordovaLib目录

下的 build.gradle 文件,


mavenCentral()
改成
jcenter {url "http://jcenter.bintray.com/"}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值