类型或命名空间名称"Windows"在 Unity 中的命名空间"UnityEngine"中不存在



我的项目运行良好,但是当我制作apk文件时,出现错误。

类型或名称名称Windows' does not exist in the namespace UnityEngine'。您是否缺少汇编参考?

找不到类型或命名空间名称`concidencelevel'。您是否缺少汇编参考?

找不到类型或名称空间名称`phraseRognizer'。您是否缺少汇编参考?

找不到类型或名称空间名称`phraseRecognizedEventargs'。您是否缺少汇编参考?

使用UnityEngine.windows.speech; < - 当我单击最高错误时显示这些位置。

我找到了解决方案为:

  1. http://answers.unity3d.com/questions/42719/how-should-i--i--i-----------------------------------------------------------------------------------------mono-ass.html。

  2. 资产 -> reimportall。

  3. 我添加了#if unity_editor,错误已消失,但在Android上不起作用:https://docs.unity3d.com/manual/platformdependentendententcompilation.html

但是它不起作用。

一些身体可以帮助我吗?谢谢所有!

unity中的Windows名称空间仅针对Windows PC构建。它不会也不应该在Android上工作。它甚至不应该为Android构建,因此您不应尝试在Android上使用Unity。

使用UNITY_STANDALONE_WIN代替UNITY_EDITOR来防止其编译其他任何平台。如果您想在Unity中进行语音识别,请参阅我描述的插件以制作我们自己的插件或使用我在答案中链接的已经制造的资产所需的类。

最新更新