I'm trying to manually configure an Android project using gradle and its wrapper, but I always have the same error.
I can generate the gradlew
script with the following build.gadle
file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.1"
}
task wrapper(type: Wrapper) {
gradleVersion = '2.6'
}
When I launch the gradlew
script I get an SSL error, here is the stacktrace:
Downloading https://services.gradle.org/distributions/gradle-2.6-bin.zip
...............
Exception in thread "main" javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Tag mismatch!
at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1541)
at sun.security.ssl.AppInputStream.available(AppInputStream.java:60)
at java.io.BufferedInputStream.available(BufferedInputStream.java:410)
at sun.net.www.MeteredStream.available(MeteredStream.java:170)
at sun.net.www.http.KeepAliveStream.close(KeepAliveStream.java:85)
at java.io.FilterInputStream.close(FilterInputStream.java:181)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(HttpURLConnection.java:3408)
at org.gradle.wrapper.Download.downloadInternal(Download.java:77)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:62)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: javax.net.ssl.SSLException: Tag mismatch!
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1020)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at sun.net.www.MeteredStream.read(MeteredStream.java:134)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3335)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3328)
at org.gradle.wrapper.Download.downloadInternal(Download.java:62)
... 7 more
Caused by: javax.crypto.AEADBadTagException: Tag mismatch!
at com.sun.crypto.provider.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:524)
at com.sun.crypto.provider.CipherCore.finalNoPadding(CipherCore.java:1023)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:960)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:479)
at javax.crypto.Cipher.doFinal(Cipher.java:2377)
at sun.security.ssl.CipherBox.decrypt(CipherBox.java:461)
at sun.security.ssl.InputRecord.decrypt(InputRecord.java:172)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1015)
... 16 more
答案 0 :(得分:4)
所以我终于想出了一个解决方案。 事实证明,从http://services.gradle.org/distributions/通过HTTPS下载包装器当时似乎无法正常工作。
然后我遇到了另一个问题,下载的存档已损坏...所以诀窍是从导航器下载存档并在gradle/wrapper/gradle-wrapper.properties
文件的路径中手动提取它然后它的工作原理喜欢魅力!
希望很快就会修复服务器。我仍然想知道问题是不是来自我的Java安装,但是,我正在运行Arch Linux并且每次更改版本时都尝试openjdk8
,jdk8
和jdk7
,要么我向前迈出了一步,要么错误信息和堆栈跟踪不同。我会试试Windows并更新这篇文章。
编辑1 :原来它在Windows上运行得非常好!问题来自我的Java安装。
编辑2 :我在朋友的互联网连接上尝试了其他地方并且意外地发现它像魅力......问题可能是我的ISP(免费)或他们给我的路由器。
答案 1 :(得分:0)
我设法通过连接到VPN并执行重新同步来解决问题。下载成功并同步到。所以我们似乎遇到了网络问题。
答案 2 :(得分:0)
我之前遇到过此问题,原因是不完整或不正确 下载gradle版本。
更改gradle-wrapper.properties中的以下行
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
单击文件->使缓存无效/重新启动
然后单击同步按钮以同步gradle文件
答案 3 :(得分:0)