Hello to all who are interesting in the issue,
I feel confused about gradle version in Android studio.
I am using the Android Studio 2.2.2. In the project build.gradle. I have classpath 'com.android.tools.build:gradle:2.2.2
which makes me believing the Android studio is using gradle 2.2.2.
In the gradle-wrapper.properties, It has https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
. So it means the gradlew build scripts requires 2.14.
When I tried to list tasks in the project, I used the terminal gradle tasks
, I had following error:
java.lang.UnsupportedClassVersionError: com/android/build/gradle/LibraryPlugin : Unsupported major.minor version 52.0
And when I run gradlew -v
I found the gradle version is 2.10. It could be me, I manually install the gradle by using apt-get install gradle
. The default version might be 2.10.
My question is, which version gradle the android studio is using and how can I update the gradle to 'correct' version so I could list the tasks in the android project?
Edit 1:
I tried to update gradle to 2.14. By using
sudo apt-cache search gradle
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle-2.14
I also tried to upgrade the gradle to version 2.14.1, but still having the same error.
Thanks for your help
Rong
A solution of solving the version 52.0 issue One suggested solution (with the similar situation I am having) solved the problem by decrease the gradle version to 2.10, I really do not want to do that, since I wish to use the update-to-date version that android studio is using.
As to the solution solved that issue: I am already having the Android 6.0 API 23 installed in the Android studio. The Android SDK 6.0 does not fix the problem in my case.
environment:
Android studio 2.2.2
Java sdk: 1.7
OS: Ubuntu 16.04 LTS