# Duplicate class found in modules

> Getting the error “Duplicate class found in modules”? Here is how to fix it. Two Android libraries ship the same class, usually Kotlin pulled in twice.

**Duplicate class found in modules.** Two dependencies include the same Java or Kotlin classes — usually different Kotlin standard library versions pulled in by plugins.

- Android build. Two libraries ship the same classes.
- Interactive page: https://capwr.app/free-tools/build-error-explainer/duplicate-class-found-in-modules
- Build error explainer: https://capwr.app/free-tools/build-error-explainer
- Last updated: 2026-10-03

## What this error means

Two dependencies include the same Java or Kotlin classes — usually different Kotlin standard library versions pulled in by plugins.

## Why it happens

Two dependencies on the release classpath ship the same classes. Plugin versions that pull different Kotlin standard-library artifacts are the common case.

## The message tools print

```
Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.7.10 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10)
```

## How to fix it

1. Update the plugins involved so they agree on Kotlin.
2. Or align Kotlin by adding the Kotlin BOM (org.jetbrains.kotlin:kotlin-bom, with your Kotlin version) as a platform dependency in android/app/build.gradle.
3. Sync and build again.

## Check a log that shows this

Paste the failing step into the [build error explainer](https://capwr.app/free-tools/build-error-explainer). It matches this message, and any others in the same log, in your browser. Nothing is uploaded.

## Other Android build errors

- [Android SDK location not found](https://capwr.app/free-tools/build-error-explainer/android-sdk-location-not-found)
- [Android Gradle plugin requires Java 17 to run](https://capwr.app/free-tools/build-error-explainer/android-gradle-plugin-requires-java)
- [:capacitor-android project could not be found](https://capwr.app/free-tools/build-error-explainer/capacitor-android-project-could-not-be-found)
- [Android resource linking failed](https://capwr.app/free-tools/build-error-explainer/android-resource-linking-failed)
- [Keystore was tampered with, or password was incorrect](https://capwr.app/free-tools/build-error-explainer/keystore-was-tampered-with-or-password-incorrect)
- [Could not resolve all files for configuration](https://capwr.app/free-tools/build-error-explainer/could-not-resolve-gradle-configuration)

## Let the Android build run in CI

CapWrapp builds the release on GitHub Actions with the JDK and Android SDK the project needs, and signs it with the upload keystore it stores for you.

[Get started free](https://capwr.app/login).

## About CapWrapp

CapWrapp turns a web app on GitHub — built with Lovable, Bolt, Base44, Cursor or by hand — into iPhone and Android apps. It adds Capacitor if the repo needs it, signs the builds, and ships them to TestFlight and Google Play from GitHub Actions, with no Mac or Xcode on your side. [Get started free](https://capwr.app/login) · [Lovable to App Store guide](https://capwr.app/guides/lovable-to-app-store)
