I add Kotlin to the gradle.build with dependency (Kotlin version 1.0.4):
As I found out it has a conflict with my other dependency:
After I run the build it crashes with the ZipException:
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/jetbrains/annotations/Nullable.class
What I already tried:
I tried this solution:
But it ended up, that not only Nullable.class and NotNull.class were duplicates, but also classes from org/intellij/lang/annotations/.
After I added five classes it still crashed. Is there a better way to get rid of this problem, by not adding every class manually that causes this exception?
As I worked a bit on the problem, I found out that for my project the relevant annotation classes are
Contract.class that are missing, if I remove
org.jetbrains:annotations-java5:15.0. They are not in kotlin-runtime, but in the Jetbrains annotation dependency. How can I add it without adding the Jetbrains annotation dependency again? Or what about adding the whole library to Kotlin?