Please note that this project was successfully compiled before upgrading to Android Studio 3.1, Gradle build tools 3.1.0 and Gradle Wrapper 4.4.
An exception occurs during the Gradle transformClassesAndResourcesWithPrepareIntermediateJarsForSomethingDebug task:
Caused by: java.util.zip.ZipException: duplicate entry: com/me/utils/model/singleModel/NodeModel.class
Note that the exception only occurs on Kotlin classes (e.g. NodeModel above). If I remove this class, an exception will occur in the next Kotlin class.
All other SO issues that mention this exception were somehow related to duplicating third-party libraries from project dependencies. This, however, is not my business, as NodeModel is its own class, which I wrote myself. This is just a simple Kotlin data class.
The project uses Kotlin version 1.2.30, build tools 27.0.3, support library 27.1.0 and Firebase 12.0.1.
I tried to clean and rebuild the project several times, changing my local JDK and built-in, nothing works.
I tried running Gradle with --stacktrace --debug to find out where the duplicate was coming from, but Gradle logs didn't mention anything meaningful.
source
share