无法与摇篮构建Android应用程序 [英] Can't build Android App with Gradle
问题描述
我试图建立我的Android应用程序使用的摇篮命令行界面。我心中已经还添加 GRADLE_HOME /箱环境。首先,我用摇篮的init生成包装,gradlew在我的项目文件夹中。现在,当我使用该包装来构建我的应用程序( ./ gradlew打造)或使用其任何功能,它会尝试下载一个gradle-2.3.zip文件,并未能在这(错误信息如下)。我不明白的是为什么摇篮再次尝试下载摇篮。此外,当我在浏览器中打开下载URL,它说,该网页是不安全的,这可能是错误的原因。我究竟做错了什么?有没有解决办法?我已成功地下载使用我的浏览器的压缩文件,但我不知道该怎么办。这是我得到的例外。
下载 https://services.gradle.org/distributions/gradle-2.3 -bin.zip
在线程异常主要javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException:无主题备用DNS 名字找到匹配services.gradle.org。在 sun.security.ssl.Alerts.getSSLException(Alerts.java:192)在 sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)在 sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)在 sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)在 sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1439) 在 sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209) 在sun.security.ssl.Handshaker.processLoop(Handshaker.java:878)在 sun.security.ssl.Handshaker.process_record(Handshaker.java:814)在 sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)在 sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) 在 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339) 在 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323) 在 sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) 在 sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
有与services.gradle.org SSL证书配置有问题,现在
<一个href="http://discuss.gradle.org/t/urgent-ssl-apache-configuration-for-services-gradle-org-is-bad/8808">http://discuss.gradle.org/t/urgent-ssl-apache-configuration-for-services-gradle-org-is-bad/8808
的开发者都知道,工作进行了修正。
这答案对同一问题提供了一种解决方法可能是合适的:
<一个href="http://stackoverflow.com/a/29576568/4776802">http://stackoverflow.com/a/29576568/4776802
I'm trying to build my Android App using the Gradle command line interface. I'v also add GRADLE_HOME/bin to the environment. Firstly, i used gradle init to generate the wrapper, gradlew in my project folder. Now, when i use this wrapper to build my app(./gradlew build) or use any of its functionality, it tries to download a gradle-2.3.zip file and fails at it(error message below). What I don't understand is why gradle try to download gradle again. Also, when I open the download url in my browser, it says that the page is insecure, which might be the cause of the error. What am I doing wrong? Is there a workaround? I have managed to download the zip file using my browser, but I don't know what to do with it. Here is the exception I got.
Downloading https://services.gradle.org/distributions/gradle-2.3-bin.zip
Exception in thread "main" javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No subject alternative DNS name matching services.gradle.org found. at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1439) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:878) at sun.security.ssl.Handshaker.process_record(Handshaker.java:814) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
There is a problem with the SSL certificate configuration on services.gradle.org right now
http://discuss.gradle.org/t/urgent-ssl-apache-configuration-for-services-gradle-org-is-bad/8808
The devs are aware and working on a fix.
This answer to the same question provides a workaround which may be suitable:
http://stackoverflow.com/a/29576568/4776802
这篇关于无法与摇篮构建Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!