Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Face Tracking causes black screen after updating to 2022.2.19

Discussion in 'AR' started by Bersaelor, May 22, 2023.

  1. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    Hey there,
    face tracking used to work fine back in 2021.3 .

    Now after moving to 2022.2.19, with ARFoundation 5.0.6 with Google ARCore XR Plugin 5.0.6.
    Now I've created the most minimal ARFoundation sample, with the most basic setup:
    Screenshot 2023-05-23 at 00.14.36.png

    When I set the FacingDirection in the component ARCameraManager to `world` I see the camera image and all works.
    When I set it to `user`, to get the user-facing camera , I just get a black screen.

    Is face tracking not supported in 5.0.6 yet?
     
    ValentineCat likes this.
  2. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    I was able to find some error messages in the Android Logcat:

    Code (CSharp):
    1.  
    2. 2023/05/24 14:05:34.121 25487 25516 Error Unity DllNotFoundException: Unable to load DLL 'UnityARCore'. Tried the load the following dynamic libraries: Unable to load dynamic library 'UnityARCore' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "UnityARCore" not found
    3. 2023/05/24 14:05:34.121 25487 25516 Error Unity   at UnityEngine.XR.ARCore.ARCoreSessionSubsystem+NativeApi.UnityARCore_session_construct (UnityEngine.XR.ARCore.ARCoreSessionSubsystem+NativeApi+CameraPermissionRequestProviderDelegate cameraPermissionRequestProvider) [0x00000] in <00000000000000000000000000000000>:0
    4. 2023/05/24 14:05:34.121 25487 25516 Error Unity   at UnityEngine.XR.ARCore.ARCoreSessionSubsystem+ARCoreProvider..ctor () [0x00000] in <00000000000000000000000000000000>:0
    5. 2023/05/24 14:05:34.121 25487 25516 Error Unity   at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00000] in <00000000000000000000000000000000>:0
    6. 2023/05/24 14:05:34.121 25487 25516 Error Unity   at UnityEngine.SubsystemsImplementation.SubsystemDescriptorWithProvider`2[TSubsystem,TProvider].CreateProvider () [0x00000] in <00000000000000000000000000000
    7.  
    and

    Code (CSharp):
    1. 2023/05/24 14:05:35.952 25487 25516 Warn Unity No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    2. 2023/05/24 14:05:35.952 25487 25516 Warn Unity UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3:GetActiveSubsystemInstance()
    3. 2023/05/24 14:05:35.952 25487 25516 Warn Unity UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3:EnsureSubsystemInstanceSet()
    4. 2023/05/24 14:05:35.952 25487 25516 Warn Unity UnityEngine.XR.ARFoundation.ARSession:OnEnable()
    5.  
    has anyone seen
    `Unable to load DLL 'UnityARCore'. ` or
    `No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available.`
    before?
     
    Last edited: May 24, 2023
  3. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    So, I was able to find the root of this.
    My old project had the package `com.google.ar.core.arfoundation.extensions` in it's `manifest.json`.
    Removing that package made the `Unable to load DLL 'UnityARCore` disappear.
     
    KyryloKuzyk and andyb-unity like this.
  4. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,121
    I believe this happened because `com.google.ar.core.arfoundation.extensions` relies on AR Foundation 4.1.5, but you use 5.0.6 in your project. This may have led to a conflict of versions.
     
    Last edited: Jun 2, 2023
    makaka-org and andyb-unity like this.
  5. ValentineCat

    ValentineCat

    Joined:
    Feb 15, 2021
    Posts:
    10
    Thanks for asking your question and posting your setup, it helped me! I didn't have AR Session.