Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue after Android studio update

I just tried to update Android studio from 1.4 to 2.2 preview 2. After updating Android Studio, when I tried to open it, it showed me this error:

Error:(1, 1) A problem occurred evaluating project ':app'.

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

enter image description here

Can any one help me to resolve this?

like image 832
fazil Avatar asked Jun 01 '16 12:06

fazil


People also ask

How do I fix Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.

Why is Android Studio so unstable?

According to Android Studio's official system requirements, it takes at minimum 3 GB RAM to run smoothly. Honestly, its a lot and I believe that is the biggest cause of being it too slow all the time. The android developers are always complaining about the speed of Android Studio and how its slow ALL THE TIME.

What is the latest update for Android Studio?

Android Studio Chipmunk | 2021.2. Android Studio - Chipmunk | 2021.2. 1 Patch 2 is now available in the Stable channel. If you already have an Android Studio build on the Stable channel, you can get the update by clicking Help > Check for Update (Android Studio > Check for Updates on macOS).

Does Android Studio make computer slow?

Since Android Studio, by default, runs a Gradle build when you start up, it manifests as an extremely slow start-up. The problem is extremely easy to check for: While you are experiencing the symptoms of a slow Android Studio, press Ctrl - Alt - Delete and open Windows Task Manager.


2 Answers

I spent quite a lot of time with this one in Android Studio too.

It seems this problem is caused by the difference in java version used for compiling the project.

Finally, inside the "Project Structure" settings window, I enabled the "Use embedded JDK (recommended)" in the SDK location tab.

And happy compiling :)

like image 183
Graph Avatar answered Oct 19 '22 16:10

Graph


Your runtime environment is running a different version of Java than your compiler - 52.0 represents Java SE 8

On Linux, type:

sudo update-alternatives --config java

Output will be like:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                     Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-oracle/jre/bin/java   2         auto mode
  1            /usr/lib/jvm/java-7-oracle/jre/bin/java   2         manual mode
* 2            /usr/lib/jvm/java-8-oracle/jre/bin/java   1         manual mode

Press <enter> to keep the current choice[*], or type selection number: 

Select 2

Then compile your project:

./gradlew assembleDebug

This fixed it for me:)

On Windows, you can do it via the Java Control Panel very easily - read more about it here!

like image 22
Wills Avatar answered Oct 19 '22 14:10

Wills