1

Under Android Studio, I am trying to build my project. There is no problem when using the classic Build or Run button, but when I try to build it through the command, using gradlew build, it fail with the message Unsupported major.minor version 52.0. In fact every command using gradlew fail. And I need it to publish my stuff to Bintray.

I am already using the latest Java 1.8 JDK, tried to clear and download every library but nothing work.

Laetan
  • 879
  • 9
  • 26

1 Answers1

1

Resolved. gradlew was actually still using Java 1.7 (which I could check with gradlew --version), even if Android Studio was correctly set to 1.8. I had to change the JAVA_HOME environment variable to a correct jdk and restart Android Studio to correct the bug.

Laetan
  • 879
  • 9
  • 26
  • 1
    And if anyone is wondering how to find which Java SDK version Android Studio (3.0 or later) is using, [here](https://stackoverflow.com/questions/47728646/how-to-find-out-the-embedded-jdk-version-of-android-studio) is answer: – Atul Sep 04 '18 at 14:57