解决方案:添加如下引用就可以解决,这个问题困扰了我两天,终于解决了

implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
  • 1.


错误如下:


FAILURE: Build completed with 2 failures.


1: Task failed with an exception.


  • What went wrong: Execution failed for task ':app:checkBaiDuDebugDuplicateClasses'.

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.5.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.21) Duplicate class kotlin.internal.jdk8.JDK8PlatformImplementations found in modules jetified-kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and jetified-kotlin-stdlib-jdk8-1.5.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.21)

2: Task failed with an exception.


  • What went wrong: Execution failed for task ':app:mergeBaiDuDebugJavaResource'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade More than one file was found with OS independent path 'META-INF/kotlin-stdlib-jdk8.kotlin_module'.