ZipException: duplicate entry on Kotlin classes

Updated answer

Even with the workaround mentioned below, I was still getting the occasional exception. Now that Android Studio 3.1.1 has been released, the issue has disappeared completely. Just make sure to also update to version 3.1.1 of the Gradle build tools, and at least version 4.4 of the Gradle wrapper:

In gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

In the project's build.gradle:

buildscript {
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        ...
    }
}

Initial answer

Increasing the Gradle Wrapper version to 4.6 fixed it for me, but only temporarily. The exception occured again the next day.

The only working solution I found so far is to downgrade the Gradle Wrapper back to 4.3.1, and the Gradle build tools to 3.0.0, until a new stable version of the Gradle build tools is available.

In gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-all.zip

In the project's build.gradle:

buildscript {
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        ...
    }
}