More than one file was found with OS independent path 'kotlin/reflect/reflect.kotlin_builtins' - Unity Project

Viewed 668

I was trying to create Android build after exporting from Unity Project. When I tried to export signed APK file, I got many errors and step by step , I have cleared all others.

But at present, get stuck on this one : enter image description here

This is my Gradle file content : enter image description here

I have tried Stackoverflow posts with similar problems. So I expect some other solution that work for me.

1 Answers

It seem it's an old post , but i m writing down here a solution it may help somebody else to solve this issue

In your app gradle (Kotlin DSL), add this block :

android {
//...

packagingOptions {
exclude("META-INF/kotlin-stdlib-common.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk7.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk8.kotlin_module")
exclude("META-INF/kotlin-stdlib.kotlin_module")
exclude("kotlin/annotation/annotation.kotlin_builtins")
exclude("kotlin/collections/collections.kotlin_builtins")
exclude("kotlin/coroutines/coroutines.kotlin_builtins")
exclude("kotlin/internal/internal.kotlin_builtins")
exclude("kotlin/kotlin.kotlin_builtins")
exclude("kotlin/ranges/ranges.kotlin_builtins")
exclude("kotlin/reflect/reflect.kotlin_builtins")
}
// ....
}

This will fix the build error.

Related