"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Vuforia Initialization failed

Once in a while Vuforia crashes with the following errors:  

NullReferenceException: Object reference not set to an instance of an object Vuforia.VideoBackgroundBehaviour.OnPreRender ()

NullReferenceException: Object reference not set to an instance of an object Vuforia.VideoBackgroundBehaviour.OnPostRender ()

If i restart the app, i get the screen that can be seen in the attached file. This seems to be generated by the DefaultInitializationErrorHandler. And when removing that script it just stays black. It will also output the following errors :

 

Vuforia initialization failed UnityEngine.Debug:LogError(Object) Vuforia.VuforiaRuntime:InitVuforia() Vuforia.VuforiaRuntime:VuforiaInitialization()

 

 

Vuforia initialization failed: INIT_ERROR

INIT ERROR

Failed to initialize Vuforia. UnityEngine.Debug:LogError(Object) DefaultInitializationErrorHandler:SetErrorCode(InitError) (at Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs:163) DefaultInitializationErrorHandler:OnVuforiaInitializationError(InitError) (at Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs:23) System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action`1, InitError) Vuforia.VuforiaRuntime:InitVuforia() Vuforia.VuforiaRuntime:VuforiaInitialization()

 

 

Vuforia cannot be started before it is initialized. Please disable Delayed Initializationin the Vuforia configuration or initialize Vuforia manually with the VuforiaRuntime-class. UnityEngine.Debug:LogError(Object) Vuforia.VuforiaARController:Start() System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action) Vuforia.VuforiaBehaviour:Start()

 

(i'm not using delayed initialization)

This seems to be a problem with the Unity editor and Vuforia since it fixes itself when restarting Unity. Is there anything that might be causing this behaviour or is there a specific version of Unity i need to use? 

 

 

I sometimes see this message too but only in the editor and only every once in a while and a Unity restart fixes it.  Might have to do with Unity's ability to talk to the webcam.  Do you have another program that is using the webcam?

I'm not using any native plugins as far as i know of. And the only library that i use is powerui. I am developing most of the time in the Rider ide though. So i'm going to work in Visual Studio today, to see if that might fix the issue and report back. 

My tests have shown that vuforia breaks this way when you edit code/script while in Play Mode! Then the next time it will say vuforia failed to initialize.

 

Hi, The same issue was reported to us by a Customer also on an android app we have made using Unity. So this is not an issue only with the editor.

Attachment