Reputation: 41
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: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/com/android/tools/build/gradle/maven-metadata.xml. Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'. repo1.maven.org
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Upvotes: 0
Views: 2287
Reputation: 1703
This is a Java SSL connection error, you need to add the appropriate SSL certificate to the Java keystore for Java accept the connection.
Step 1 : Download the certificate
With Mozilla Firefox:
- Go to https://repo1.maven.org
- Click on the green padlock at the left of adress bar.
- Click on Details.
- Click on View certificate.
- Click on Details.
- Click on Export.
- Export file to "X.509 Certificate (PEM) (*.crt; *.pem)"
Step 2 : Add the certificate to default java keystore
sudo keytool -import -alias MavenRepo -keystore $JAVA_HOME/jre/lib/security/cacerts -file /PATH/TO/YOUR/EXPORTED/FILE.crt
Your
$JAVA_HOME
variable is normally declared in your.bashrc
file, so you can use this command just replacing the/PATH/TO/YOUR/EXPORTED/FILE
parameter.PS : The default password of java keystore is : changeit
From: https://github.com/meteor/meteor/issues/6362#issuecomment-189852511
Upvotes: 2
Reputation: 2180
I got in same trouble, previously I was using cordova 4.0 and eclipse which was using ant for build.
But from cordova 5.0 it requires gradle. I just installed android studio and mapped my old sdk downloaded with eclipse. As I mapped it and opened one of cordova created project in android studio. I got one error but due to one of stackoverflow question here, I solved the issue.
Created new project and it took some time to download all the dependencies, but at last it solved. Now I can create with CMD.
So key of the answer is you need to install android studio if you are still using eclipse.
check mine answer here as well getting gradle error while creating cordova project
Upvotes: 1