Gradle Duplicate Class Fixer for Android Builds

    by Singgih Rochmad Saputro

    1

    Turns a wall of "Duplicate class ... found in modules" errors into the one to three causes behind it, shows which dependency pulls each side in, and writes the build.gradle.kts fix.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Gradle Duplicate Class Fixer for Android Builds

    Example session with this skill installed

    My release build fails with ~200 lines of "Duplicate class ... found in modules". Here's build.txt and the output of ./gradlew :app:dependencies --configuration releaseRuntimeClasspath.

    • Read your context and instructions
    • Compiled the gradle duplicate class

    Duplicate classes

    9 duplicate classes, 4 causes.

    1. Kotlin stdlib jdk7/jdk8 split

    Modules: kotlin-stdlib-jdk8:1.6.21, kotlin-stdlib:1.9.22, kotlin-stdlib-jdk7:1.6.21
    kotlin-stdlib-jdk8:1.6.21 comes from: com.legacy:charts:1.3.0 → kotlin-stdlib-jdk8:1.6.21

        dependencies {
            implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.22"))
        }
    

    2. Guava and listenablefuture

    listenablefuture:1.0 comes from: androidx.work:work-runtime:2.8.1 → listenablefuture:1.0

    implementation("com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava")
    

    3. AndroidX artifacts at different versions

    lifecycle-common-java8:2.4.0 vs lifecycle-common:2.6.1

    implementation("androidx.lifecycle:lifecycle-common-java8:2.6.1")
    

    4. Two libraries ship the same classes

    com.acme:payments-sdk:2.4.0 bundles okio; okio-jvm comes from payments-sdk → okhttp → okio

        implementation("com.acme:payments-sdk:2.4.0") {
            exclude(group = "com.squareup.okio", module = "okio-jvm")
        }
    

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A "Duplicate class" error means two jars on the runtime classpath contain the same class. Gradle prints every class, often hundreds of lines, which hides the fact that there are usually only one to three causes. This skill groups them, explains each, and gives the smallest build change that removes one side.

    1. The failing build output, as text. From Android Studio's Build window (switch to the text view) or from the terminal:

    2. The dependency tree for the same variant (strongly recommended; without it the skill can't say which of your dependencies brings each side):

    Use releaseRuntimeClasspath if the release build is the one failing, and the module that fails (:app is the usual one).

    Prefers aligning versions over excluding modules, because an exclude can remove classes a library needs at runtime; excludes are the fallback for unknown pairs. Old AGP versions print module names without Maven coordinates, so the report says less for them. The script does not read your build files: the agent writes the edit in your style (Kotlin DSL, Groovy or version catalog).

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    Software
    Python 3.8+
    Optional
    Gradle project (to get the dependency tree)

    Permissions

    Terminal / Shell
    Read Files

    File Scopes

    The
    build
    output
    and
    dependency
    tree
    files
    you
    point
    it
    at
    (read
    only)

    The bundled script uses only the Python standard library, makes no network calls and writes only to the terminal. The agent edits your build.gradle(.kts) only when you ask it to apply the fix.

    Listed4 days ago

    What's inside

    Frequently Asked Questions

    Turns a wall of "Duplicate class ... found in modules" errors into the one to three causes behind it, shows which dependency pulls each side in, and writes the build.gradle.kts fix.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Gradle Duplicate Class Fixer for Android Builds on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in Mobile Development

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Mobile Development.