【问题标题】:Ionic build android throws `Could not resolve com.android.tools.build:gradle:2.1.0` on UbuntuIonic build android 在 Ubuntu 上抛出`Could not resolve com.android.tools.build:gradle:2.1.0`
【发布时间】:2016-08-27 18:03:23
【问题描述】:

这是我在ionic build android 之后的堆栈跟踪,经过简单的三个步骤即可开始使用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

【问题讨论】:

    标签: android cordova gradle ionic-framework


    【解决方案1】:

    我遇到了同样的问题,我手动安装 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 和他的路径,但我认为解决它并不重要。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-01
      • 2015-11-26
      • 2022-12-25
      • 1970-01-01
      • 1970-01-01
      • 2023-01-12
      相关资源
      最近更新 更多