Tag Archives: minCompileSdk

[Solved] AndroidStudio Error: checkDebugAarMetadata & CheckAarMetadataWorkAction

Description

Execution failed for task ':app:checkDebugAarMetadata'.

> Multiple task action failures occurred:

   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction

      > 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.recyclerview:recyclerview:1.3.0-alpha02.

If you upgrade to compilesdk 31 according to the prompt, you are faced with a large number of Android 12 and below are not available, and upgrade the current jdk8 to jdk11 or above, but the set of source code was still available more than 2 months ago. Now it is not available for no reason, which is not in line with the routine.

If the current compilesdk is kept at 30 or 28, gradle compiles and passes, but the above error is reported when running debugging.

I can’t understand it.

Solution:

Take the following three steps to finally solve the problem
1. keep the current compilesdk at 30 or 28.

2. lower the corresponding version number of dependent components, such as dependency: Android. Recyclerview: recyclerview: 1.3.0-alpha02. Change the original version number of the corresponding gradle file from 1. + to 1.2. +, that is, lower the version number by one. Shape such as

The original gradle file is implementation 'androidx.recyclerview:recyclerview:1.+'// means 1.xx latest version, maybe 1.0, 1.1, 1.2, 1.3, 1.4, 1.5 in that order

Now read
implementation 'androidx.recyclerview:recyclerview:1.2.+'// means 1.2.xx latest version, maybe 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5 in that order

3. After recompiling, debug and run again, and the prompt of the dependent component does not appear again, indicating that the modification is effective. By analogy, reduce the version number of other dependent components until similar prompt no longer appears, and the problem is solved.