google-ar / arcore-unity-extensions

Google ARCore Extensions and Geospatial Creator for Unity's AR Foundation
Other
351 stars 98 forks source link

checkReleaseDuplicateClasses fails in Unity 2023.2.X #188

Open Jocke155 opened 6 months ago

Jocke155 commented 6 months ago

Versions:
Unity 2023.2.19f1, 2023.2.20f1 ARCore Extensions: 1.42.0 AR Foundation: 5.1.3 AR Core: 5.1.3

Reproduce:

  1. I added the ARCore Extensions by the git url (https://github.com/google-ar/arcore-unity-extensions.git), to an existing project using the package manager.
  2. I enabled it for AR Foundation V5 using "ARCORE_USE_ARF_5" in Player Settings.
  3. I enabled Geospatial in Player Settings. Build now fails.

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.v4.app.INotificationSideChannel found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.os.IResultReceiver found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.os.ResultReceiver found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.os.ResultReceiver$1 found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:) Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.0:) and support-compat-25.1.0-runtime (:support-compat-25.1.0:)

Edit:

I've also tried removing ARCore, ARKit and AR Foundation from the package manager before installing. I'm suspecting it has to do with how it resolves the Android dependencies, because if I remove resolved libraries, it builds but the camera no longer works in the app.

Jocke155 commented 6 months ago

I can now confirm that this happens in a completely new project where I have done the following:

  1. Create a new 3D project in 2023.2.19f.
  2. Install AR Foundation, ARCore and ARKit 5.1.3 in Package Manager.
  3. Setup XR (AR Session, XR Origin), remove Vulkan etc in Player Settings (Following the guide).
  4. Install ARCore Extensions using git link.
  5. Add "ARCORE_USE_ARF_5" to "Scripting Define Symbols" in "Player -> Other Settings"
  6. Add a "ARCoreExtensionsConfig" to the "ARCore Extensions" GameObject.
  7. Enable "Geospatial Mode" and "Streetscape Geometry Mode" in ARCoreExtensionsConfig.
  8. Build an APK (Fails!).
Jocke155 commented 5 months ago

I can now confirm that it appears to work to build in 2022.3.26f1 (LTS). This means that it's an issue related to later versions, in Unity 2023.2.X.