Black Screen

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)

1 Like

Please review the AR Foundation > Basic Setup documentation.

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.

2 Likes

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.

3 Likes

Thanks @HEROTECH70 it was driving me crazy!!!

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.

2 Likes

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.

4 Likes

Be sure to configure the provider plugin for your target system.

https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.1/manual/index.html#provider-plugin-setup

https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.1/manual/migration-guide-3.html#xr-plug-in-management

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?

after i updated to Ar foundation 4.0 it still dosn’t work it the dosent get activated

Same issue for me as well using the latest unity and AR foundation

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

I resolved by setting Assets/Settings/ForwardRender as in the image below.
I checked on ‘New AR Background Renderer Feature’.

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.

Downgrade your ar foundation and arcore/arkit packages to the verified versions and resolve the issue for xr management. Worked for me

Update:
fixed this issue after upgrading my unity version to 2020.1

Original reply:
did you found any solution for this?

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:

No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
UnityEngine.XR.ARFoundation.ARSession:OnEnable() (at Library/PackageCache/com.unity.xr.arfoundation@4.0.8/Runtime/AR/ARSession.cs:341)
No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
UnityEngine.XR.ARFoundation.ARInputManager:OnEnable() (at Library/PackageCache/com.unity.xr.arfoundation@4.0.8/Runtime/AR/ARInputManager.cs:24)
No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
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?

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).

1 Like

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.

InvalidOperationException: Could not find shader named 'Unlit/ARKitBackground' required for video overlay on camera subsystem.
No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
No active UnityEngine.XR.ARSubsystems.XRDepthSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
No active UnityEngine.XR.ARSubsystems.XRPlaneSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
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

using System.Collections;
using UnityEngine;
using UnityEngine.XR.Management;

public class InitXr : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(StartXR());
    }

    IEnumerator StartXR()
    {
        yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
        if (XRGeneralSettings.Instance.Manager.activeLoader == null)
        {
            Debug.LogError("Initializing XR Failed. Check Editor or Player log for details.");
        }
        else
        {
            Debug.Log("Starting XR...");
            XRGeneralSettings.Instance.Manager.StartSubsystems();
            yield return null;
        }
    }
}

This and all the above suggestions still wont work for me. Version 4.0.9 on every package.

1 Like