Received fatal alert: protocol_version build failure Gradle/Maven

Maven Central and Bintray have announced that they will discontinue support for TLS v1.1 and below. You will be affected if you are using Java 6 or 7 and using Gradle versions 2.1 through 4.8.

GRADLE:

Check gradle version

gradle --version

You must take action if all of these are true:

  • JVM version is Java 7u130 or lower and
  • Gradle version is between 2.1 and 4.8, inclusive
  • and you have declared a repository {} of mavenCentral() or jcenter()

You can take any one of the following actions to use TLS v1.2+:

  • Run Gradle with Java 1.7.0_131-b31 or above
  • or upgrade to Gradle 4.8.1 or above
  • or replace mavenCentral() with maven { url = "http://repo.maven.apache.org/maven2" } and jcenter() with maven { url = "http://jcenter.bintray.com" }

The first two solutions are recommended, as the third opens a possible attack vector.

Source:https://blog.gradle.org

Maven:

If you are using Maven use the command given below

mvn -Dhttps.protocols=TLSv1.2 install