Building APK: Execution failed for task ':launcher:checkReleaseDuplicateClasses'

Hey, I’ve been trying to build my Unity project to Android for a few weeks now but I cant get past this issue.

Whenever I attempt to build I get this error:


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
   > Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.8.0-runtime (androidx.browser:browser:1.8.0) and jetified-androidx.browser.browser-1.8.0-runtime (:androidx.browser.browser-1.8.0:)
     Duplicate class android.support.customtabs.ICustomTabsCallback$Default found in modules browser-1.8.0-runtime (androidx.browser:browser:1.8.0) and jetified-androidx.browser.browser-1.8.0-runtime (:androidx.browser.browser-1.8.0:)
     Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.8.0-runtime (androidx.browser:browser:1.8.0) and jetified-androidx.browser.browser-1.8.0-runtime (:androidx.browser.browser-1.8.0:)
     Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.8.0-runtime (androidx.browser:browser:1.8.0) and jetified-androidx.browser.browser-1.8.0-runtime (:androidx.browser.browser-1.8.0:)
     Duplicate class android.support.customtabs.ICustomTabsCallback$_Parcel found in modules browser-1.8.0-runtime (androidx.browser:browser:1.8.0) and jetified-androidx.browser.browser-1.8.0-runtime (:androidx.browser.browser-1.8.0:)

etc…

Things i’ve tried:

  • Reimporting all assets
  • Removing Libary folder & rebuilding
  • Resolve & Force Resolve
  • Deleting plugins folder
  • and many more

I’ve read countless forum posts but none of the answers there seem to work for me. This seems to have started as soon as I added google-admob into the project. I have followed the google-admob documentation and have enabled all of the revlant settings such as gradle template, gradle settings etc but still no effect.

I’ve also tried multiple Unity versions to no avail!

At my wits end almost, Is there anybody out there that might know what I could be missing?

Many Thanks!

Please submit a bug from within the Unity Editor by selecting “Help → Report a Bug…”, and attach the project where you encountered the issue so our Customer QA team can investigate.

What unity versions have you tried?

As @Oyvind_F suggested, if you have a reproducible project, please report a bug and we will look into it.