androidkotlinandroid-studiogradledowngrade

Android Studio: Gradle demoted library version from xx.xx to yy.yy


Suddenly -and for an unknown reason for me- I've started to receive a "Gradle demoted library version from xx.xx to yy.yy" warning when trying to update packages from "Project Structure" > Suggestions.

After years working with Android and Kotlin it's the first time I see this warning, so I don't know what to do to update my packages.

Two weird things:

  1. It's giving this warning not for just one specific package, but for all.
  2. I wasn't able to find any information / references about this warning anywhere on the net, but at the link I'm pasting below, which is not helpful for me.

I need to clearly understand what this error means, I mean, what it happens, and mostly why it happens for all the packages.

I've already upgraded my targetSdk to 35 with the SDK upgrade assistant (just in case) to no avail.

My Android Studio is "Koala" 2024.1.2

What should I try next to update my packages to latest versions without this warning?

Libraries demoted

What to do when seeing Gradle demoted library version


Solution

  • When different dependencies in the project try to use different versions of the same library, to ensure compatibility gradle will demote to the lowest required version

    Open terminal & run

    ./gradlew :app:dependencies
    

    and check conflicts