Android studio compilation error: 2 files found with path 'META-INF/kotlinx_coroutines_core.version'.

android studio compilation error:

2 files found with path 'META-INF/kotlinx_coroutines_core.version'.
Adding a packagingOptions block may help

Click the upper level to report the reason for the error:

Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:

Solution: Add packagingOptions configuration to android{} in the app module's build.gradle file, and exclude META-INF/kotlinx_coroutines_core.version:

    packagingOptions {
        exclude 'META-INF/kotlinx_coroutines_core.version'
    }

Guess you like

Origin blog.csdn.net/zhangphil/article/details/129302957