Coding⏱️ 2 min read📅 2026-05-31

How to Fix: How can I resolve the error "The minCompileSdk (31) specified in a dependency's AAR metadata" in native Java or Kotlin?

Resolve Android Gradle error: minCompileSdk mismatch between dependency and project.

Quick Answer: Update the project's compileSdkVersion to match or exceed the minimum specified in the dependency's AAR metadata.

To resolve the error 'The minCompileSdk (31) specified in a dependency's AAR metadata' is greater than this module's compileSdkVersion (android-30), follow these steps:

✅ Best Solutions to Fix It

Method 1: Update the compileSdkVersion

  1. Step 1: Open your project's build.gradle file and update the compileSdkVersion to a version that is compatible with the minCompileSdk specified in the dependency's AAR metadata.

Method 2: Update the minCompileSdk for the project

  1. Step 1: Open your project's build.gradle file and update the minCompileSdk to a version that is greater than or equal to the minCompileSdk specified in the dependency's AAR metadata.

🎯 Final Words

By following these steps, you should be able to resolve the error 'The minCompileSdk (31) specified in a dependency's AAR metadata' is greater than this module's compileSdkVersion (android-30).

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions