gpt4 book ai didi

android - Android 上的 Cordova 构建错误

转载 作者:行者123 更新时间:2023-11-29 02:29:15 25 4
gpt4 key购买 nike

我正在尝试构建和执行我的 cordova 项目,但我遇到了错误:

BUILD FAILED                                                                                                           
Total time: 5.696 secs FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not find common.jar (android.arch.core:common:1.1.0). Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not find common.jar (android.arch.core:common:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

重点是同一个项目上周能够构建/运行,而今天不再工作了。有人遇到过这个问题并找到了解决方案吗?

最佳答案

打开platforms/android/然后build.gradle

添加maven { url ' https://maven.google.com ' } 在 jcenter() 之前

allprojects
{
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}

google() 和 maven { url ' https://maven.google.com ' } 指向相同的 repo 协议(protocol),google() 是 Google 的 Maven repo 协议(protocol)快捷方式。您可以添加 google() 而不是 maven { url ' https://maven.google.com '} 如果您正在使用:

Gradle >= v.4.x+

看来顺序很重要,这对我有用

关于android - Android 上的 Cordova 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50568769/

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