Skip to content

Troubleshooting

Build fails with checkReleaseDuplicateClasses

If your build fails with an error like this:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
error during build.

add the Kotlin BOM to the dependencies block in mainTemplate.gradle:

dependencies {
    ...
    implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
}

This ensures consistent Kotlin stdlib versions across transitive dependencies.

If you use EDM4U (External Dependency Manager for Unity), do not put this line between // Android Resolver Dependencies Start and // Android Resolver Dependencies End, or EDM4U may overwrite it.

Source: https://kotlinlang.org/docs/whatsnew18.html#usage-of-the-latest-kotlin-stdlib-version-in-transitive-dependencies