Short answer
Read the two module names in the error. If they are kotlin-stdlib and kotlin-stdlib-jdk7 or -jdk8, align the Kotlin versions: update the Kotlin Gradle plugin and any library pinning an old stdlib, or add the Kotlin BOM. If the same library appears twice (a local .jar plus the Maven artifact, or bundled inside another library), remove one. Otherwise run ./gradlew app:dependencies, find which dependency brings the second copy, and exclude that module from it.
Where the second copy comes from, and the fix
01
Mixed Kotlin standard library versions
“Note that mixing different versions of stdlib artifacts could lead to class duplication or to missing classes.” Kotlin, What’s new in Kotlin 1.8.0
Since Kotlin 1.8, the contents of kotlin-stdlib-jdk7 and kotlin-stdlib-jdk8 live in kotlin-stdlib. A project or plugin that still pulls an older jdk8 artifact next to a new kotlin-stdlib gets the same classes twice. Update the Kotlin Gradle plugin (in Flutter, in android/settings.gradle, or ext.kotlin_version in android/build.gradle on older projects), update the libraries that pin old versions, and replace explicit jdk7 or jdk8 dependencies with kotlin-stdlib. The Kotlin BOM aligns the rest.
// app/build.gradle.kts dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.24")) }02
The same library is included twice
“Your app has a local binary dependency and a remote binary dependency on the same library. To resolve this issue, remove one of the binary dependencies.” Android Developers, Fix dependency resolution errors
A .jar or .aar copied into libs/ and the same library from Maven, or a library that already bundles another one you also declare, both put the classes on the classpath. Remove the direct dependency or the local file.
03
Find which dependency brings the copy
“Type the name of the class that appears in the build error. Inspect the results for the dependencies that include the class.” Android Developers, Fix dependency resolution errors
Print the dependency tree and search it for the module names from the error. In Android Studio, Navigate > Class with Include non-project items checked shows every library that contains the class.
# from the android folder in Flutter and React Native projects cd android && ./gradlew app:dependencies --configuration releaseRuntimeClasspath | grep -n "stdlib"04
Old support libraries next to AndroidX
Duplicate class android.support.v4... next to androidx... means an old library still uses the Android Support Library. Set android.useAndroidX=true in gradle.properties, update the library to an AndroidX version, and enable android.enableJetifier=true only as a stopgap, because it slows every build.
# android/gradle.properties android.useAndroidX=true android.enableJetifier=true # temporary, until the old library is updated05
Exclude the module from the dependency that brings it
When a library you need brings an extra copy you cannot remove by upgrading, exclude that module from it. A common case is Guava’s listenablefuture clashing with a full Guava.
// Kotlin DSL (build.gradle.kts) dependencies { implementation("some-library") { exclude(group = "com.google.guava", module = "listenablefuture") } } // Groovy (build.gradle, Flutter and React Native) implementation('some-library') { exclude group: 'com.google.guava', module: 'listenablefuture' }
Checked against the vendor’s docs on : Android Developers: Fix dependency resolution errors (duplicate classes); Kotlin: What’s new in Kotlin 1.8.0 (jdk7 and jdk8 merged into kotlin-stdlib).
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
Related: Flutter Kotlin Gradle plugin version · Android “Manifest merger failed” · Gradle “Could not resolve all files”