Home › Build error fixes › Android / Gradle

Duplicate classes from two dependencies

Android / Gradle · last reviewed 2026-11-10

The error looks like this

Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.0

Why it happens

Two libraries bundle the same classes (common with old support libs vs AndroidX, or kotlin-stdlib-jdk7/8).

How to fix it

  1. Read the two module names in the log.
  2. Exclude one: implementation(...) { exclude group: "...", module: "..." }
  3. Upgrade the older library.

Not sure this is your error? Let ReleaseMedic read the whole log

Build logs are long and the last line is rarely the real cause. ReleaseMedic finds the first real error, explains it and gives the steps — free, and the log never leaves your computer.

$ npx releasemedic log build.log

Or pipe a build straight in: cd android && ./gradlew bundleRelease 2>&1 | npx releasemedic log -

Catch it before you build

Most release errors come from project settings you can check in seconds — signing, SDK levels, privacy manifests, permissions, push and login setup.

$ npx releasemedic

Related Android / Gradle errors