[英]error CS0234: The type or namespace name 'Persistence' does not exist in the namespace 'UnityEngine.XR.WSA' (are you missing an assembly reference?)
I'm currently developing an app for android. 我目前正在为Android开发一个应用。 In my code, I use the namespace UnityEngine.XR.WSA.Persistence
. 在我的代码中,我使用名称空间UnityEngine.XR.WSA.Persistence
。 When I'm launching the app on the editor, i have no errors, but when I try to build this to send it to my phone, I get the following one : 在编辑器上启动应用程序时,没有任何错误,但是当我尝试构建此应用程序以将其发送到手机时,得到以下消息:
The type or namespace name "Persistence" does not exist in the namespace "UnityEngine.XR.WSA". 类型或名称空间名称“ Persistence”在名称空间“ UnityEngine.XR.WSA”中不存在。 Are you missing an assembly reference?" 您是否缺少装配参考?”
Isn't it strange since it's working on the editor? 因为它在编辑器上工作,这并不奇怪吗? How do i fix it? 我如何解决它?
WSA
stands for Windows Store Apps
. WSA
代表Windows Store Apps
。 This is only available when building apps for Universal Windows Platform
. 仅在为Universal Windows Platform
构建应用程序时可用。 Especially UnityEngine.XR.WSA.Persistence
afaik is or at least was previously developed by Microsoft and is even only used in particular for the HoloLens . 特别是UnityEngine.XR.WSA.Persistence
afaik是或至少由Microsoft以前开发的,甚至仅专门用于HoloLens 。
It throws no exceptions in the Editor but afaik some #if
preprocessors make sure that it also does nothing there. 它在编辑器中不引发任何异常,但是会怀疑某些#if
预处理器确保它在此也什么也不做。
It is not available when building an App for Android
platforms. 在为Android
平台构建应用程序时,该功能不可用。
To remove the error in your script you can use #if
preprocessors and Platform dependent compilation like 要消除脚本中的错误,您可以使用#if
预处理程序和依赖于平台的编译,例如
#if UNITY_WSA
// anything using the UnityEngine.XR.WSA namespace
#else
// alternative implementation for different platform
#endif
however, the functionality ofcourse will not be available on Android so if you need something similar you have to use another library or come up with one ;) 但是,courses的功能在Android上将不可用,因此,如果您需要类似的功能,则必须使用另一个库或提供一个;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.