Search Unity

Resolved Black Screen

Discussion in 'AR' started by HEROTECH70, May 8, 2020.

  1. HEROTECH70

    HEROTECH70

    Joined:
    May 24, 2017
    Posts:
    34
    I am trying to add ARFoundation to an existing project, I downloaded the ARFoundationDemos project from the AssetStore and it worked fine in an empty project, If I try to set up the scene the same way as in the demo project I just get a black screen.

    One thing I noticed is that on the demo project it asks automatically for camera permission while on my project it doesn't. Even if I manually give permission the screen is still black (tried with the unity permission api too)

    Can anyone help please? I considered rebuilding the project from the demo project but it would take me far too long (this was an existing vuforia project but we decided to move to ARFoundation)
     
  2. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    168
  3. HEROTECH70

    HEROTECH70

    Joined:
    May 24, 2017
    Posts:
    34
    Yes I already followed those instructions, and then I tried to copy the setup from the demo projects provided.
    Since it still didn't work I decided to fire up Logcat and I noticed this warning

    2020/05/10 10:06:01.433 6877 6923 Warn Unity No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    could you please update the "getting started" documentation to include this step? I re-read it multiple times to make sure I am not just an idiot and didn't see it but I think it's not there.

    To make it work you have to go into project settings XR Plug-in Management and select the XR plug-in providers you need for your project.
    Once I ticked ARCore the camera started working correctly.

    Edit:
    Nevermind, there is something in the existing project that is screwing things up bad.

    ARTrackedImageManager.trackedImagesChanged is never being called
    Although tracking is working
    Also I just noticed there is no TrackedPoseDriver attached to the AR Camera, only a generic ArPoseDriver script.
    The only way to get the right behaviour on it is to upgrade to ARFoundation 4.0
    I guess I will have to make a new project and slowly import everything in there.
     
    Last edited: May 10, 2020
    Tarrag and ganaware like this.
  4. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    168
    Thank you for pointing out that our documentation is lacking on the XR management steps in the Basic Setup guide.

    We are adding those details that should be available following the next release.
     
    hmkn, Tarrag and ganaware like this.
  5. _slash_

    _slash_

    Joined:
    Mar 26, 2013
    Posts:
    22
  6. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    132
    EDIT: Solved by adding the XR interaction toolkit package.
    What is confusing with the documentation is that without the package, you still see the interface for the provider setup and you can select the provider. But without the package mentioned, the project doesn't work.
    I would suggest to explicitly say that you need to install the package?
    ----------

    Original post:
    Im also having these issues.I made many ARF projects before.
    But with ARF4:
    - I added the usual suspect: AR session and AR Session Origin from the XR menu, which (should) create the correct camera setup etc.
    In the Project Settings' XR plugin Management I selected ARKit.

    Still I get:
    InvalidOperationException: Could not find shader named 'Unlit/ARKitBackground' required for video overlay on camera subsystem. at UnityEngine.XR.ARSubsystems.XRCameraSubsystem+Provider.CreateCameraMaterial

    And:
    No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    What could it be?
    Only I noticed that ARF is version 4.0.2, while ARKit plugin is 4.0.1 and that ARsubsystems is not shown in the package manager while it is installed.
     

    Attached Files:

    Last edited: Jun 20, 2020
    kamathamA likes this.
  7. art1997

    art1997

    Joined:
    Apr 7, 2017
    Posts:
    40
    HI . wanted to try ARF 4.1 for depth api for android. but have black screen.
    Any idea how to solve?
    Debug Message
    No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
     
    quangtqag and hmkn like this.
  8. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    168
  9. R42_Leon

    R42_Leon

    Joined:
    Feb 24, 2016
    Posts:
    25
    I was facing the same issue after upgrading from ARFoundation 3.1.0 (working fine) to 4.0 (aforementioned black screen issue & log error messages about no active UnityEngine.XR.ARSubsystems.XRSessionSubsystem being available).

    The fix was to add the XR interaction toolkit package as suggested by Jelmer123 (note that as of now the packed is in preview).

    I am confused as to whether that's needed - as far as I know that package should just include a collection of higher-level utilities to implement interaction patterns with objects (mostly in VR, nonetheless) and nothing "essential" for ARFoundation initialization?
     
  10. vishwah13

    vishwah13

    Joined:
    Jun 22, 2019
    Posts:
    4
    after i updated to Ar foundation 4.0 it still dosn't work it the dosent get activated
     
  11. dude898

    dude898

    Joined:
    Nov 28, 2017
    Posts:
    6
    Same issue for me as well using the latest unity and AR foundation
     
  12. jj1991

    jj1991

    Joined:
    Jul 19, 2017
    Posts:
    10
    I can't enable ARCore in xr plugi-in management, when I click the checkbox nothing happens, arfoudnation 4.0.2 and arcore 4.0.3 are installed in package manager
     
  13. nariran

    nariran

    Joined:
    Aug 10, 2020
    Posts:
    1
    I resolved by setting Assets/Settings/ForwardRender as in the image below.
    I checked on 'New AR Background Renderer Feature'.
    スクリーンショット 2020-08-11 3.56.37.png
     
  14. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    75
    I feel sure there's a bug in ARF 4.02/4.08. I've tried everything I can think of, with both default pipeline and URP.
    ARF 2.1 and 3.1 worked fine.
    Android.
     
  15. vijaysaiturai1997

    vijaysaiturai1997

    Joined:
    Oct 1, 2019
    Posts:
    1
    Downgrade your ar foundation and arcore/arkit packages to the verified versions and resolve the issue for xr management. Worked for me
     
  16. soorya696

    soorya696

    Joined:
    Dec 13, 2018
    Posts:
    71
    Update:
    fixed this issue after upgrading my unity version to 2020.1

    Original reply:
    did you found any solution for this?
     
    Last edited: Sep 23, 2020
  17. rosaelisa

    rosaelisa

    Joined:
    Aug 28, 2020
    Posts:
    1
    I am having the same problem trying to setup for Android development on Unity Version 2019.4.10f1
    I am using version 4.08 of "AR Foundation", "AR Subsystems and ARCore XR Plugin" as well as XR Interaction Subsystems 1.0.1 and have set "ARCore" as well as "Mock HMD Loader" as PlugIn providers in XR Plug-in Management in the Project Settings.
    Unfortunately I still get three warnings:

    Code (CSharp):
    1. No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    2. UnityEngine.XR.ARFoundation.ARSession:OnEnable() (at Library/PackageCache/com.unity.xr.arfoundation@4.0.8/Runtime/AR/ARSession.cs:341)
    Code (CSharp):
    1. No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    2. UnityEngine.XR.ARFoundation.ARInputManager:OnEnable() (at Library/PackageCache/com.unity.xr.arfoundation@4.0.8/Runtime/AR/ARInputManager.cs:24)
    Code (CSharp):
    1. No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    2. UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`2:OnEnable() (at Library/PackageCache/com.unity.xr.arfoundation@4.0.8/Runtime/AR/SubsystemLifecycleManager.cs:87)
    Can I still try anything else apart from downgrading the versions?
     
  18. JeffScm

    JeffScm

    Joined:
    Oct 18, 2013
    Posts:
    16
    Anyway there is a bug in the XR Plugin Management. When trying to upgrade from older versions.
    - After migrating to 4.1 the ARKit Provider was Checked
    - Camera was not working
    - Went back to Unity and Un-checked and Check again the ARKit provider

    Guess? Now it works as it should.
    Also the start guide doesn't mention any of this while upgrading. (make sure you have unchecked/checked providers so Unity can actually reload).
     
  19. ElasticSea

    ElasticSea

    Joined:
    Aug 10, 2016
    Posts:
    10
    So I downloaded ar-foundation-samples-latest-preview and ar-foundation-samples-4.0 branches from GitHub and opened them in the appropriate unity version specified in ProjectVersion.txt. I made sure that "Initialize XR on Startup" and "ARkit" provider were checked and all the xr packages in the package manager were installed.

    I still had the black screen with error messages that submodules were missing.
    Code (CSharp):
    1. InvalidOperationException: Could not find shader named 'Unlit/ARKitBackground' required for video overlay on camera subsystem.
    2. No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    3. No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    4. No active UnityEngine.XR.ARSubsystems.XRDepthSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    5. No active UnityEngine.XR.ARSubsystems.XRPlaneSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    6. No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
    The only thing that helped was to trigger the XR setup manually with the following script

    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.XR.Management;
    4.  
    5. public class InitXr : MonoBehaviour
    6. {
    7.     void Start()
    8.     {
    9.         StartCoroutine(StartXR());
    10.     }
    11.  
    12.     IEnumerator StartXR()
    13.     {
    14.         yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
    15.         if (XRGeneralSettings.Instance.Manager.activeLoader == null)
    16.         {
    17.             Debug.LogError("Initializing XR Failed. Check Editor or Player log for details.");
    18.         }
    19.         else
    20.         {
    21.             Debug.Log("Starting XR...");
    22.             XRGeneralSettings.Instance.Manager.StartSubsystems();
    23.             yield return null;
    24.         }
    25.     }
    26. }
     
    Last edited: Oct 16, 2020
  20. ashleyjamesbrown

    ashleyjamesbrown

    Joined:
    May 23, 2018
    Posts:
    10

    This and all the above suggestions still wont work for me. Version 4.0.9 on every package.
     
    maniac-tech likes this.
  21. puppetisto

    puppetisto

    Joined:
    Jun 21, 2020
    Posts:
    4
    Any other solutions for this issue? I am still getting the error, unfortunately.
     
  22. joaoparissantos

    joaoparissantos

    Joined:
    Aug 14, 2019
    Posts:
    1
    Did you manage to find a solution? I am have the same problem.
     
    puppetisto likes this.
  23. Chihippo

    Chihippo

    Joined:
    May 31, 2014
    Posts:
    3
    Same. Unity 2019.4.6f1
    Done everything everyone has suggested on this list and am still getting the same 5 XR.ARSubsystems not being available.

    Even ElasticSea's InitXr script produces the "Initializing XR Failed. Check Editor or Player log for details" error.
     
  24. timmy2get

    timmy2get

    Joined:
    Mar 2, 2018
    Posts:
    4
    [SOLVED]
    (At least for me)
    Unity 2020.2.0b11 + ARKit XR Plugin 4.1.1 solved it. and @JeffScm was right about going to Player Settings -> XR Plugin Management -> Initialize XR on Startup [V check] and Plug-in Providers ARKit [V check].
     
  25. inhan-virnect

    inhan-virnect

    Joined:
    Sep 4, 2020
    Posts:
    1
    upload_2020-12-8_10-52-38.png

    @timmy2get Thank you! It's working at my android device.
     
unityunity