android – 创建cordova项目时出现gradle错误


A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve
     Required by:
      > Failed to list versions for
         > Unable to load Maven meta-data from
            > Could not GET '
               > peer not authenticated

经过2天的痛苦,我开始知道它是由于gradle而来,我下载并将其添加到环境变量中.当我在cordova项目中访问android文件夹并给出gradle init命令时,我也会收到此错误.不知道是什么原因造成的.我仍然使用eclipse而不是android studio这也是一个原因吗?

这是一个Java SSL连接错误,您需要将适当的SSL证书添加到Java Keystore for Java接受连接.

Step 1: Download the certificate

With Mozilla Firefox:

  1. Go to https:// (remove the space).
  2. Click on the green padlock at the left of the address 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


Your $JAVA_HOME variable should be declared in your 07000, 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: 07001

转载注明原文:android – 创建cordova项目时出现gradle错误 - 代码日志