我试图开发一个带有 Vuforia 引擎功能的 Unity 项目以部署到 HoloLens。简短的问题摘要:它不起作用。我开始使用 Vuforia AR 相机和放置在视野中的 3D 立方体创建一个非常简单的项目,只是为了测试它。它可以在 Unity 预览中呈现它。然而,Unity 控制台出现错误,Unity 程序既不能在 HoloLens 上运行,也不能作为 Visual Studio 预览中的独立应用程序运行。总是发生的一个错误是:
DllNotFoundException:VuforiaWrapper。
可以在 Visual Studio 中构建一个独立的应用程序,它会按应有的方式呈现 3D 立方体,但背景是黑色的,相机不工作(Razer Kiyo)。
我已经尝试了几个 Unity 版本,包括 2017 和 2018 的 LTS 版本以及 Visual Studio 2017 和 2019。它不适用于上述任何一个版本。
将 Vuforia Hololens 样本导入 Unity 会破坏项目,并使其无法在我尝试过的每个 Unity 版本中编译,因此我不得不放弃它。
有人知道如何解决这个问题吗?它甚至不适用于这样一个简单的项目,这似乎很奇怪。
从附加的 Visual Studio 构建中查找日志文件:
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)