Kai K.
Kai K.

Reputation: 11

Unity Development for HoloLens

I have tried to develop a Unity project with Vuforia engine function to be deployed to the HoloLens. Short problem summary: It doesn't work. I started with creating a very simple project with the Vuforia AR camera and a 3D cube placed in the view field, just to test it. It works to present it in the Unity preview. Yet, the Unity console presents errors and neither does the Unity program work on the HoloLens, nor as a standalone app in the Visual Studio preview. One errors that always occurs is:

DllNotFoundException: VuforiaWrapper.

A standalone app can be built in Visual Studio and it presents the 3D cube as it should but the background is black, the camera doesn't work (Razer Kiyo).

I have tried several Unity versions, incluiding the LTS versions of 2017 and 2018 and Visual Studio 2017 and 2019. It works with none of the above.

Importing the Vuforia Hololens sample into Unity crushes the project and makes it uncompilable for EVERY Unity version I have tried, so I had to step away from that.

Does someone have an idea how to solve this? It seems strange that it doesn't even work for such a simple project.

Find log file from Visual Studio build attached:

    Mono path[0] = 'C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build   /bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Managed'
Mono config path = 'C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/x64/Debug/MonoBleedingEdge/etc'
PlayerConnection initialized from C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55402
Multi-casting "[IP] 10.4.2.246 [Port] 55402 [Flags] 2 [Guid] 682190711 [EditorId] 0 [Version] 1048832 [Id] WindowsPlayer(DeepThought) [Debug] 0 [PackageName] WindowsPlayer" to [225.0.0.222:54997]...
Started listening to [0.0.0.0:55402]
PlayerConnection already initialized - listening to [0.0.0.0:55402]
Initialize engine version: 2018.4.11f1 (7098af2f11ea)
GfxDevice: creating device client; threaded=1
XR: OpenVR Error! OpenVR failed initialization with error code VRInitError_Init_PathRegistryNotFound: "Installation path could not be located (110)"!

(Filename: C:\buildslave\unity\build\Runtime/VR/OpenVR/OpenVR.cpp Line: 1835)

Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA GeForce RTX 2080 Ti (ID=0x1e04)
    Vendor:   
    VRAM:     11049 MB
    Driver:   25.21.14.1967
Begin MonoManager ReloadAssembly
- Completed reload, in  0.100 seconds
<RI> Initializing input.

XInput1_3.dll not found. Trying XInput9_1_0.dll instead...
<RI> Input initialized.

<RI> Initialized touch support.

XR: OpenVR Error! OpenVR failed initialization with error code VRInitError_Init_PathRegistryNotFound: "Installation path could not be located (110)"!

(Filename: C:\buildslave\unity\build\Runtime/VR/OpenVR/OpenVR.cpp Line: 1835)

XR: OpenVR Error! OpenVR failed initialization with error code VRInitError_Init_PathRegistryNotFound: "Installation path could not be located (110)"!

(Filename: C:\buildslave\unity\build\Runtime/VR/OpenVR/OpenVR.cpp Line: 1835)

UnloadTime: 0.641200 ms
Compiled for Play Mode
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.PlatformRuntimeInitialization:InitPlatform()

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
DllNotFoundException: VuforiaWrapper
  at (wrapper managed-to-native) Vuforia.VuforiaNativeWrapper.initPlatformNative()
  at Vuforia.VuforiaNativeWrapper.InitPlatformNative () [0x00000] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.PlayModeUnityPlayer.InitializePlatform () [0x00005] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.VuforiaRuntime.InitPlatform (Vuforia.IUnityPlayer player) [0x0000b] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.PlatformRuntimeInitialization.InitPlatform () [0x00097] in <77657aff10f3423b8360b40ff8e9348d>:0 

(Filename: <77657aff10f3423b8360b40ff8e9348d> Line: 0)

Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: VuforiaWrapper
  at (wrapper managed-to-native) Vuforia.VuforiaNativeWrapper.deviceIsEyewearDevice()
  at Vuforia.VuforiaNativeWrapper.DeviceIsEyewearDevice () [0x00000] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.Device.get_Instance () [0x00024] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.VideoBackgroundManager.Initialize () [0x00000] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.VuforiaARController.Awake () [0x0008b] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <791f603facc4473dab4bf640d012ebda>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004b] in <791f603facc4473dab4bf640d012ebda>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <791f603facc4473dab4bf640d012ebda>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <791f603facc4473dab4bf640d012ebda>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <791f603facc4473dab4bf640d012ebda>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <791f603facc4473dab4bf640d012ebda>:0 
  at Vuforia.DelegateHelper.InvokeDelegate (System.Delegate action, System.Object[] args) [0x0000f] in <77657aff10f3423b8360b40ff8e9348d>:0 
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])
Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)
Vuforia.VuforiaBehaviour:Awake()

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Initializing Vuforia Engine
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.VuforiaRuntime:InitVuforia()
Vuforia.VuforiaRuntime:VuforiaInitialization()

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper.dll
Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/libVuforiaWrapper
DllNotFoundException: VuforiaWrapper
  at (wrapper managed-to-native) Vuforia.VuforiaNativeWrapper.getVuforiaLibraryVersion(System.Text.StringBuilder,int)
  at Vuforia.VuforiaNativeWrapper.GetVuforiaLibraryVersion (System.Text.StringBuilder value, System.Int32 maxLength) [0x00000] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.VuforiaUnity.GetVuforiaLibraryVersion () [0x0000d] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.VuforiaRuntime.LogVersions () [0x00000] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.VuforiaRuntime.InitVuforia () [0x00012] in <77657aff10f3423b8360b40ff8e9348d>:0 
  at Vuforia.VuforiaRuntime.VuforiaInitialization () [0x0001d] in <77657aff10f3423b8360b40ff8e9348d>:0 

(Filename: <77657aff10f3423b8360b40ff8e9348d> Line: 0)

Vuforia Engine cannot be started before it is initialized.
 Please disable Delayed Initializationin the Vuforia configuration or initialize Vuforia manually with the VuforiaRuntime-class.
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Vuforia.VuforiaARController:Start()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
System.Delegate:DynamicInvokeImpl(Object[])
System.MulticastDelegate:DynamicInvokeImpl(Object[])
System.Delegate:DynamicInvoke(Object[])
Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])
Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)
Vuforia.VuforiaBehaviour:Start()

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Upvotes: 1

Views: 531

Answers (1)

Julia Schwarz
Julia Schwarz

Reputation: 2650

The error DllNotFoundException: VuforiaWrapper indicates that Unity is trying to load a dll, but the DLL doesn't seem to exist at the location being loaded.

Reading the errors, there are many of the form:

Fallback handler could not load library C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono/VuforiaWrapper.dll

Have you checked the path "C:/Visual Studio Projects/UnityHololens2018_4_11VuforiaUpdate8_5_8_64_86_Test1/build/bin/UnityHololens2018_4_11TestVuforiaUpdate8_5_8_Data/Mono" to verify that the files exist there? It seems like that error message is from running locally on your machine, so you should be able to just examine the directory.

Usually when I see dll not found errors, it is because my plugin dlls are not configured correctly. Check the plugin documentation and double check that the vuforia dll is configured to deploy on your machine architecture, and HoloLens architecture (which is x86).

Upvotes: 0

Related Questions