I just updated cordova version from 4.0 to 5.1, and everything worked fine also in creating project. But as soon as I gave command of cordova build I got below error.
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:1.0.0+.
Required by:
:android:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://repo1.maven.org/maven2/co
m/android/tools/build/gradle/maven-metadata.xml.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/bu
ild/gradle/maven-metadata.xml'.
> peer not authenticated
After 2 days suffering I came to know it's coming due to gradle, I downloaded and added it also in environment variable. I do get this error also when I go to android folder in cordova project and give command of gradle init. Don't know what can be reason of it. Am still using eclipse instead of android studio can it also be a reason ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…