Last day android studio project was working but suddenly happened like this error: minCompileSdk(31) specified in a
When running the app in Android Studio gets this “The minCompileSdk (31) specified in a” type of error, don’t worry because here you’re going to get the step by step solution to the error.
Error log
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.appcompat:appcompat:1.4.0.
AAR metadata file: C:\Users\New\.gradle\caches\transforms-2\files-2.1\975a7ab88f08d678a5f54c41a8383515\appcompat-1.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.
If you are getting above type of error logs while running your project then understand the error log carefully because other reasons are also responsible for this type of error.
First of all clear invalidate caches and restart…
File->invalidate caches/restart…
If the same type of error is appearing again
Here, solve the error by app appcompat dependency. Changed dependency version and it will be working. Defined here “Dependency: androidx.appcompat:appcompat:1.4.0.”
Go to build.gradle (module: My_Application.app) and check appcompat version and change version, it may work.
Default version 1.4.0. Then after changing to 1.0.0 then it works.
Maybe appcompat:1.4.0 supports mincompiledsdk(31) so getting this type of error.