How to Debug Which Dependency Adds a Specific Library or Class Encountering a duplicate class error or an unexpected library in your Android project? A common culprit is a transitive dependency —a library that is automatically included by one of your direct dependencies. Thankfully, Gradle provides a powerful tool to investigate this: the dependency tree. This guide will show you how to generate and read this tree to find the source of any problem library, like the common listenablefuture conflict. The Quick Command The simplest way to see your project's dependency hierarchy is to run a command in the terminal. Open the Terminal inside Android Studio ( View > Tool Windows > Terminal ). Run the following command: bash ./gradlew app:dependencies This will output the entire dependency tree for your app module to the terminal. If your main module has a different name (e.g., myapp ), replace app with that name: bash ...