close

[Fixed] The minCompileSdk (31) specified in a dependency’s AAR metadata is greater than this module’s compileSdkVersion

Today We are Going To Solve The minCompileSdk (31) specified in a dependency’s AAR metadata is greater than this module’s compileSdkVersion in Java. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix The minCompileSdk (31) specified in a dependency’s AAR metadata is greater than this module’s compileSdkVersion Error?

  1. How to Fix The minCompileSdk (31) specified in a dependency’s AAR metadata is greater than this module’s compileSdkVersion Error?

    To Fix The minCompileSdk (31) specified in a dependency’s AAR metadata is greater than this module’s compileSdkVersion Error just Add this line in the app Gradle file. To solve this error you have to just add this line in the app Gradle file. Add this to app Gradle fine. It's only for Kotlin developers: configurations.all { resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' } } If you are using java then just add this configurations.all { resolutionStrategy { force 'androidx.core:core:1.6.0' } }

  2. The minCompileSdk (31) specified in a dependency’s AAR metadata is greater than this module’s compileSdkVersion

    To Fix The minCompileSdk (31) specified in a dependency’s AAR metadata is greater than this module’s compileSdkVersion Error just Increase the compileSdk of your project. You can solve this error very easily. You have to just increase the compileSdk of your project. There is no need to change the targetSdk. Just try something like that and increase the compileSdk of your project.
    android { compileSdk 31 ... }

Solution 1 : Add this line in the app Gradle file.

To solve this error you have to just add this line in the app Gradle file.

Add this to app Gradle fine. It’s only for Kotlin developers:

configurations.all {
    resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
}

If you are using java then just add this

configurations.all {
    resolutionStrategy { force 'androidx.core:core:1.6.0' }
}

Solution 2 : Increase the compileSdk of your project

You can solve this error very easily. You have to just increase the compileSdk of your project. There is no need to change the targetSdk. Just try something like that and increase the compileSdk of your project.

android {
    compileSdk 31

...
}

Solution 3 : Change the beta version

To solve this error you have to just change the beta version from

androidx.lifecycle:lifecycle-livedata:2.4.0beta1

to current stable version,

androidx.lifecycle:lifecycle-livedata:2.3.1

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read This Solutions

Leave a Comment