# Duplicate files copied in APK

**URL:** <https://discuss.kotlinlang.org/t/duplicate-files-copied-in-apk/2044>\
**Category:** Android\
**Created:** [October 17, 2016, 10:29am UTC](https://discuss.kotlinlang.org/t/duplicate-files-copied-in-apk/2044 "2016-10-17T10:29:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom.czura](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@tom.czura](https://discuss.kotlinlang.org/u/tom.czura)\
**Post date:** [October 17, 2016, 10:29am UTC](https://discuss.kotlinlang.org/t/duplicate-files-copied-in-apk/2044/1 "2016-10-17T10:29:19Z")

</div>

I have a problem with version 1.0.4 ( it was also with 1.0.3), Android Studio 2.2, Gradle 2.2.1:

FAILURE: Build failed with an exception.

- What went wrong:  
Execution failed for task ‘:app:transformResourcesWithMergeJavaResForMitrakoRelease’.

> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK kotlin/internal/internal.kotlin\_builtins  
> File1: /home/astalos/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-runtime/1.0.4/8e25da5e31669f5acf514bdd99b94ff5c7003b3b/kotlin-runtime-1.0.4.jar  
> File2: /home/astalos/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.0.4/172b43fbc03b521fed141484b212d6725fa671a9/kotlin-compiler-embeddable-1.0.4.jar

- Try:  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Gradle buildscript is as basic as possible. What might cause this error?

---

<div class="post-metadata">

**Author:** ![yole](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yole/32/1425_2.png) [@yole](https://discuss.kotlinlang.org/u/yole)\
**Post date:** [October 17, 2016, 10:44am UTC](https://discuss.kotlinlang.org/t/duplicate-files-copied-in-apk/2044/2 "2016-10-17T10:44:29Z")

</div>

Please show how exactly your build script is configured. Looks like you’ve added the Kotlin compiler as the dependency of your application, and you shouldn’t do that.

---

<div class="post-metadata">

**Author:** ![ankul09jain](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@ankul09jain](https://discuss.kotlinlang.org/u/ankul09jain)\
**Post date:** [January 14, 2017, 6:22am UTC](https://discuss.kotlinlang.org/t/duplicate-files-copied-in-apk/2044/3 "2017-01-14T06:22:24Z")

</div>

Hi Yole. I am facing the same problem. Please find my gradle files in the below link:

[http://stackoverflow.com/questions/41642982/duplicatefileexception-in-apk-build-using-kotlin](http://stackoverflow.com/questions/41642982/duplicatefileexception-in-apk-build-using-kotlin)

Let me know if the build script is configured wrong?
