user2130898
user2130898

Reputation: 41

When running the "Cordova build android" I'm getting the below exception

FAILURE: Build failed with an exception.

Upvotes: 0

Views: 2287

Answers (2)

Pierre Cavin
Pierre Cavin

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:

  1. Go to https://repo1.maven.org
  2. Click on the green padlock at the left of adress bar.
  3. Click on Details.
  4. Click on View certificate.
  5. Click on Details.
  6. Click on Export.
  7. 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

nirmal
nirmal

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

Related Questions