Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

> Task :app:checkDebugDuplicateClasses FAILED

Tags:

android

gradle

Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules jetified-kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and jetified-kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
     Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations found in modules jetified-kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and jetified-kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
     Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations$ReflectSdkVersion found in modules jetified-kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and jetified-kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
like image 855
Sumit Ojha Avatar asked Mar 25 '26 07:03

Sumit Ojha


2 Answers

Please try this line of code in gradle.

id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
like image 52
Mukesh Kumar Patel Avatar answered Mar 28 '26 01:03

Mukesh Kumar Patel


I have been facing a similar issue with my flutter project and from my assessment the reason is due to a conflicting Kotlin version.

I was running

kotlin_version = '1.7.10'

And had installed

kotlin_version = '1.8.20'

The solution is I updated my project to the latest installed version and it worked for me.

like image 41
Daniel Opiyo Avatar answered Mar 28 '26 02:03

Daniel Opiyo