Invalid TLS padding data (gradle-core:2.1.3)

android

(Shane Gannon) #1

I’m using Gradle in an Android build and I’m seeing an intermiddent build error

load https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.1.3/gradle-core-2.1.3.jar
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'jabber-android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not download gradle-core.jar (com.android.tools.build:gradle-core:2.1.3)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.1.3/gradle-core-2.1.3.jar'.
         > Invalid TLS padding data

When the error occurs on a machine it repeates for all future builds. Searching the cache (~/.grade) I noticed that

/home/build/.gradle/caches/modules-2/files-2.1/com.android.tools.build/gradle-core/2.1.3/3e359ba5992f824747ab483ca796926a846fd650/gradle-core-2.1.3.pom

is downloaded but

/home/build/.gradle/caches/modules-2/files-2.1/com.android.tools.build/gradle-core/2.1.3/e94f0de6fa76f0a76011bdcc82d23ee1e5e707fa/gradle-core-2.1.3.jar

is missing on a machine with the problem. If I delete ~/.grade it might get resolved by the next build. But this is random. i.e. Sometimes it fails again.

The one constant is that the failure always occurs with gradle-core-2.1.3.jar.

I started to see this problem after moving the build to Ubuntu 14.04. Previously, on SLED 11 SP 2, the build was fine. I’m using Java 1.7.0_71 on the Ubuntu machine. The SLED machine should have used the same version of Java. But it may have used Java 6.

Anyone any idea how I can fix this issue?

gradlew -v


Gradle 2.14.1

Build time: 2016-07-18 06:38:37 UTC
Revision: d9e2113d9fb05a5caabba61798bdb8dfdca83719

Groovy: 2.4.4
Ant: Apache Ant™ version 1.9.6 compiled on June 29 2015
JVM: 1.7.0_71 (Oracle Corporation 24.71-b01)
OS: Linux 3.19.0-43-generic amd64


(Shane Gannon) #2

After spending time testing it I can say I only see this problem when using

repositories {
        jcenter()
}

If I switch over to

repositories {
        mavenCentral()
}

I cannot reproduce the issue above. i.e. In build.gradle


(Shane Gannon) #3

After installing JDK 1.8 the error is now

Download https://jcenter.bintray.com/com/neenbedankt/gradle/plugins/android-apt/1.8/android-apt-1.8.jar
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.1.3/gradle-core-2.1.3.jar

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'jabber-android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not download gradle-core.jar (com.android.tools.build:gradle-core:2.1.3)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.1.3/gradle-core-2.1.3.jar'.
         > Tag mismatch!