Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
2.99k stars 1.11k forks source link

No image tracking subsystem found[Bug] #1015

Closed adrianARXR closed 8 months ago

adrianARXR commented 1 year ago

I am trying to create a RuntimeReferenceImageLibrary and I have always this error: NotSupportedException: No image tracking subsystem found. This usually means image tracking is not supported. UnityEngine.XR.ARFoundation.ARTrackedImageManager.CreateRuntimeLibrary (UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary serializedLibrary) (at Library/PackageCache/com.unity.xr.arfoundation@4.2.6/Runtime/AR/ARTrackedImageManager.cs:95)

I rode in some official websides that you can know if you subsystem support runtime libraries with the function: **m_TrackedImageManager.descriptor.supportsMutableLibrary. It was null in my project so basically it doesn't support.

Is there any way to change my subsystem and make it possible ?

ankur-unity commented 1 year ago

m_TrackedImageManager.descriptor.supportsMutableLibrary is a bool and cannot be null. Do you mean that it was false?

supportsMutableLibrary will be true only if the provider for your target platform supports MutableRuntimeReferenceImageLibrary. Note that the MutableRuntimeReferenceImageLibrary is a version of RuntimeReferenceImageLibrary. A provider can support RuntimeReferenceImageLibrary even if they don't support MutableRuntimeReferenceImageLibrary.

Which means you can use ARTrackedImageManager.CreateRuntimeLibrary even when supportsMutableLibrary is false. The error that you're seeing is because the image tracking subsystem was not loaded in your project. Can you check if ARTrackedImageManager is present and enabled in your scene?

Also what's your target platform? It is possible that the provider for your target platform does not support image tracking.

adrianARXR commented 1 year ago

Thanks in advance for your Sorry I don't have a clear idea of how is the connection between the elements. I checked all the things that you mentioned and I've done some tests. I used this code for making sure of what is working and what is not: ` public XRReferenceImageLibrary serializedLibrary; //Set up in the editor private ARTrackedImageManager trackedImageManager; //Set up in the awake function

`

if (trackedImageManager != null) { if(serializedLibrary != null) { if (trackedImageManager.enabled == true) { Debug.Log("Image manager and XR Reference found"); RuntimeReferenceImageLibrary runtimeLibrary = trackedImageManager.CreateRuntimeLibrary(serializedLibrary); } } } imagen

As you could see the script can find the ARTrackedImageManager and the XRReference.I already have a system working with this ARTrackedImageManager and the XRReferenceImageLibrary where I was able to detect all the images and everything is working fine. The problem is when I want to use the method CreateRuntimeLibrary of the ARTrackedImageManager .

Thanks a lot ! :)

ankur-unity commented 1 year ago

When are you calling the CreateRuntimeLibrary API? Is it in the Awake method as well?

ankur-unity commented 1 year ago

The image tracking subsystem is started in TrackedImageManager.OnEnable(). I recommend creating the library in Start() or a later lifecycle event so that the subsystem is initialized and started before you try to create a runtime library.

adrianARXR commented 1 year ago

I called the CreateRuntimeLibrary in the Start function and in other functions after a few seconds but I got the same result

dbenitez83 commented 1 year ago

Hi, I'm having the same problem and I'm not able to find the solution. ¿Did you at the end solved it? I'm using ARCore 4.1.13 and my Android target is ARMv7 8.1 Oreo

Thanks in advance

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andyb-unity commented 8 months ago

Closing this issue due to inactivity. If you are still experiencing issues with your image tracking subsystem, please file a bug: https://unity3d.com/unity/qa/bug-reporting. GitHub issues on this repo are unofficial and may not be triaged.

If you do file a bug, you are welcome to re-open this issue and provide us your bug ID number for tracking purposes. Thanks