Dependency requires compileSdk 🤖 Android

Dependency 'androidx.x:1.y' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs

A library needs a higher compileSdk than your module uses (checkAarMetadata task).

Seen on: Android

Meaning

New AndroidX/Material versions require recent compileSdk. compileSdk only affects compilation (not minSdk), so raising it is usually safe; AGP may also need upgrading for very new compileSdk values.

Common causes

  • compileSdk lower than a dependency requires
  • Library upgraded via BOM/transitive dependency
  • AGP too old for the needed compileSdk

⚡ Quick fix

  1. Raise compileSdk to the required level
  2. Upgrade AGP if it warns about the compileSdk
  3. Or pin the dependency to an older version

Detailed fix by platform

Gradle

  1. kotlin
    android {
      compileSdk = 35
    }

How to diagnose

  1. Task — checkDebugAarMetadata output
  2. Dependency — Which library forces it?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.