Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio : Cause: dagger/hilt/android/plugin/HiltGradlePlugin has been compiled by a more recent version of the Java Runtime

Tags:

java

android

I am getting this error while opening a project

Cause: dagger/hilt/android/plugin/HiltGradlePlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

What i tried are :

Plugin [id: 'dagger.hilt.android.plugin'] was not found in any of the following sources

https://github.com/google/dagger/issues/3495

Dagger-hilt error while compiling project

Class has been compiled by a more recent version of the Java Environment

How to resovle Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 error?

java.lang.UnsupportedClassVersionError while integrating firebase performance library in react native app

java.lang.unsupportedclassversionerror in gradle build

The Hilt Android Gradle plugin is applied but no com.google.dagger:hilt-android-compiler dependency was found

like image 685
Rahul R Avatar asked Feb 16 '26 12:02

Rahul R


1 Answers

The YouTube link solution reported fixed the issue in my case, however here the instructions for the very latest Android Studio version (Android Studio Dolphin | 2021.3.1 Patch 1) on MacOS

  1. Select your project App main folder in the Android Studio Project panel
  2. Right click -> Open Module Settings
  3. Select the Project entry below the Project Settings section
  4. In the drop-down menu next to SDK, select the Java 11 version
  5. Click on Apply and OK
  6. Rebuild the project

If this doesn't work could be something deeper messed up in your machine JDK configuration or IDE configuration, would be easier I think to uninstall completely the IDE, clean the configuration file and install from scratch. It could be overkill but sometime this is the most reliable way especially when nothing works.

like image 146
Paolo Moschini Avatar answered Feb 19 '26 02:02

Paolo Moschini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!