DEV Community

Abhishek Jaiswal
Abhishek Jaiswal

Posted on

Java Android Studio Error

Error

The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.lifecycle:lifecycle-runtime:2.4.0. AAR metadata file: C:\Users\jaisw.gradle\caches\transforms-3\55824bd6c9b41f557d64668e082ada18\transformed\lifecycle-runtime-2.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.

The solution is in the error itself. There can be two solutions:

Before

Image description

Use Android SDK version 31 in your project. Find compileSdkVersion 30 in your app\build.gradle file, and change it to compileSdkVersion 31.
Force gradle to use an older version of the dependency androidx.lifecycle:lifecycle-process:2.4.0. If you are not directly using this dependency, force gradle to use an older version like this:

After
Image description

Thank You!

Top comments (0)