Skip to main content

How to Fix "4 issues were found when checking AAR metadata" in Android Studio

Fixing the "4 issues were found when checking AAR metadata" Error

The error Execution failed for task ':app:checkDebugAarMetadata' is a common but frustrating build failure in Android Studio. It indicates a problem with the metadata of one or more Android Archive (AAR) libraries your project depends on.

This guide will help you diagnose the root cause and provide step-by-step solutions to resolve it.

Step 1: Diagnose the Problem

The error message is generic. To find the specific culprit, you need more detailed logs.

  1. Open the Terminal in Android Studio (View > Tool Windows > Terminal).

  2. Run one of the following commands to get verbose output:

    bash
./gradlew :app:checkDebugAarMetadata --info

or for even more detail:

bash

./gradlew :app:checkDebugAarMetadata --debug
  1. Scan the output for lines containing "AAR metadata" or specific library names. The log will explicitly tell you which library is causing the issue and why (e.g., minSdkVersion mismatch).

Step 2: Apply the Fix (Based on the Cause)

Once you've identified the problematic library, apply the relevant solution.

🔧 Fix 1: minSdkVersion Mismatch (Most Common)

This occurs when a library requires a higher minimum Android version than your app.

  • Solution A (Recommended): Raise your app's minSdkVersion to meet the library's requirement.
    Open your app/build.gradle file and update the value:

    gradle
android {
    defaultConfig {
        minSdkVersion 21 // <-- Increase this number
        targetSdkVersion 34
    }
}

Solution B (Use with Caution): Forcefully override the check for a specific library. Warning: This can cause runtime crashes on older devices if the library uses unsupported APIs.
Add this to your AndroidManifest.xml:

xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools">

    <uses-sdk tools:overrideLibrary="com.problematic.library.package.name" />
    <!-- Replace with the actual library's package name -->

    <application ...> ... </application>
</manifest>

Fix 2: Corrupted Cache or AAR File

Sometimes, the downloaded library files get corrupted.

  1. Clean your project: Build > Clean Project in Android Studio or run ./gradlew clean in the terminal.

  2. Invalidate Caches: Go to File > Invalidate Caches / Restart... and select Invalidate and Restart.

  3. Delete Gradle cache manually:

    • Windows: C:\Users\[YourUsername]\.gradle\caches

    • macOS/Linux: ~/.gradle/caches

    • Delete the modules-2 and transforms-X folders inside. Gradle will re-download everything on the next build.

🔧 Fix 3: Incompatible Dependencies

Your project's library versions might conflict with each other or with your build tools.

  1. Update everything: Ensure your Android Gradle Plugin (AGP), Gradle version, and libraries are compatible and up-to-date.

    • Project-level build.gradle:

      gradle
plugins {
    id 'com.android.application' version '8.9.1' apply false // Use latest stable version
}

gradle-wrapper.properties:

properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip

App-level build.gradle:

gradle
android {
    compileSdk 36
    // ...
}

Downgrade strategically: If you can't update your build tools, try downgrading the problematic library to the last compatible version. For example, if androidx.core is the issue:

gradle
dependencies {
    implementation "androidx.core:core:1.16.0"
    implementation "androidx.core:core-ktx:1.16.0"
}

Summary and Recommendation

  • First, always run ./gradlew --info to identify the exact library and error.

  • The most common fix is to increase your app's minSdkVersion in build.gradle.

  • If you're starting a new project or can update, upgrading your Android Gradle Plugin (AGP) and compileSdk is the best long-term solution.

  • Use the overrideLibrary manifest flag only as a last resort if you fully understand the risks.

By methodically following these steps, you can resolve the AAR metadata error and get your build back on track.

Comments

Popular posts from this blog

How to set Profile Attribute in Siebel Workflow

For setting the Profile Attribute in Siebel Workflow, follow below steps: Add Business Service box in workflow. Open Business Service properties. Set  SessionAccessService in Business Service Name. Set  SetProfileAttr in Method Name. Then click on Business Service and set Input Arguments as below: Against Name argument you will add your profile attribute name and against Value argument you will add value for the new profile attribute, it could be from Process Property or Literal.

How to call Popup Applet through Server Script in Siebel

Background: Based on the requirements you need to show data or reports on a popup applet. You can invoke popup applet using workflow (below business service will be used in business service step), applet server script or browser script and using vanilla method and setting field user properties. Procedure: Below is the script for calling popup applet through server script: if (MethodName == "MethodName") { var oServiceAF = TheApplication().GetService("SLM Save List Service"); var inputPropAF = TheApplication().NewPropertySet(); var outputPropAF = TheApplication().NewPropertySet(); inputPropAF.SetProperty("Applet Name","ABC Popup Applet"); inputPropAF.SetProperty("Applet Mode","6"); inputPropAF.SetProperty("Applet Height", "700"); inputPropAF.SetProperty("Applet Width", "700"); oServiceAF.InvokeMethod("LoadPopupApplet", inputPropAF, outputPropAF) return (CancelOperati...

How to query or find record in Siebel Business Component

You can perform query operation on Business Component through Workflow, eScript with the help of Siebel Operation, Inbound E-mail Database Operations (method: FindRecord) or EAI Siebel Adapter (method: Query but you need to create Integration Objects). This Business Component can be Virtual Business Component (VBC), External Business Component (EBC) or generic Business Component (BC).  See also: Difference Between Business Components and How to Create BC in Siebel through Object Wizard through Workflow with the help of Siebel Operation Create a workflow and provide the Business Object, business component should be in this BO for which you want to perform the query operation. From the Palettes window drag drop the Siebel Operation into workflow designer plane. Select the Siebel Operation box and open the properties window, provide the Business Component name from the drop down list and set Query in Operation field. You can set the search specification by two means either provide the...