gpt4 book ai didi

android - ionic 构建Android在Ubuntu上抛出 `Could not resolve com.android.tools.build:gradle:2.1.0`

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

这是我在ionic build android之后的stacktrace,经过简单的三个步骤开始使用ionic:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.1.0.
Required by:
:android:unspecified
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

所有代码都是 $ ionic start myApp tabs附带的默认代码

我试图更改gradle版本,更新cordova。
我也尝试在build.gradle中添加以下行:
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}

我也这样做了,以防万一:
When running the "Cordova build android" I'm getting the below exception

最佳答案

我有同样的问题,我解决了手动安装gradle的问题。

https://gradle.org/gradle-download/

我做了以下命令:

curl -s https://get.sdkman.io | bash

sdk install gradle 2.1 # Changing 3.1 version to 2.1

我必须重新启动计算机才能正确配置路径。
以前我检查过它和java及其路径的配置是否正确,但我认为解决它并不重要。

关于android - ionic 构建Android在Ubuntu上抛出 `Could not resolve com.android.tools.build:gradle:2.1.0`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39184197/

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