Android cannot build via Gradle - Duplicate arcore classes found

  • Issue category: Android ARDK build
  • Device type & OS version: Android
  • Host machine & OS version: Windows 10
  • ARDK version: 2.5.1
  • Unity version: 2022.1.18f1
  • Lightship Maps: Beta 3

Description of the issue:

The issue stems from a previous build error I was trying to solve, which someone else posted about it here
https://community.nianticspatial.com/t/android-cannot-build-a-failure-occurred-while-executing-com-android-build-gradle-internal-tasks-workers-actionfacade/2749

Thus when following Building for Android API level 31 with OpenCL via Gradle

I get the following Build Errors:

  • What went wrong:
    Execution failed for task ‘:launcher:checkReleaseDuplicateClasses’.

1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class a.a.a found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class a.a.b found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class b.a.a found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.a.a found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.a.b found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.a.c found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.b.a.a.a.a found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.b.a.a.a.b found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.b.a.a.a.c found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.b.a.a.a.d found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.a.b.a.a.a.e found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.ar.core.Anchor found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.ar.core.Anchor$CloudAnchorState found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
Duplicate class com.google.ar.core.ArCoreApk found in modules arcore-runtime.jar (:arcore:) and arcore-runtime.jar (:core-1.22.0:)
etc…

I see others bringing up similar issues in this forum and the broader internet, however I’m just not sure where/what files to hone in as to remove these duplicate arcore modules.

Sorry for the necessary handholding. Thank you for any and all help!

Hello John,

By any chance would you happen to have anything ARCore related installed in your Package Manager? You can go to Window → Package Manager and make sure you select the filter for packages in the project. If there is anything there that has its own ARCore version try removing it and then restart Unity.

Additionally, can you also go into the Project Settings and all the way at the bottom you will see XR Plugin Management. Make sure you remove anything that’s there and restart Unity as well.

1 Like

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.