这是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
答案 0 :(得分:0)
我遇到了同样的问题,我解决了手动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和他的路径,但我认为解决它并不重要。