DEV Community

Stephen Muindi
Stephen Muindi

Posted on

Answer: Duplicate class in Kotlin Android

Adding this code inside app level/build.gradle

dependencies{
 ....
    constraints{
        implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10'
        implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
    }
}

and adding this code inside project level/build.gradle

dependencies {
    .....
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
}

It fixed this error 100%. It worked for me.

Top comments (1)

Collapse
 
muindistephen profile image
Stephen Muindi

Worked