C# 在Unity中构建到Android时出错

C# 在Unity中构建到Android时出错,c#,android,unity3d,C#,Android,Unity3d,我在首选项中设置了SDK和JDK,每次尝试运行时都会出现以下错误。真的不知道是什么问题。我的手机上也启用了调试功能 Assets/Vuforia/Scripts/Utilities/VRIntegrationHelper.cs(99,29):错误CS1061:TypeUnityEngine.Camera“不包含SetTereoProjectMatrix”的定义,并且找不到类型为UnityEngine.Camera的扩展方法。是否缺少程序集引用 生成播放机时出错,因为脚本有编译器错误 生成已完成,

我在首选项中设置了SDK和JDK,每次尝试运行时都会出现以下错误。真的不知道是什么问题。我的手机上也启用了调试功能

Assets/Vuforia/Scripts/Utilities/VRIntegrationHelper.cs(99,29):错误CS1061:Type
UnityEngine.Camera“不包含
SetTereoProjectMatrix”的定义,并且找不到类型为UnityEngine.Camera的扩展方法。是否缺少程序集引用

生成播放机时出错,因为脚本有编译器错误

生成已完成,结果为“失败”

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:182 
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:89 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


您需要更改代码:

mLeftCamera.SetStereoProjectionMatrices(mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
mRightCamera.SetStereoProjectionMatrices (mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
关于这一点:

mLeftCamera.SetStereoProjectionMatrix (Camera.StereoscopicEye.Left, mRightCamera.projectionMatrix);
mRightCamera.SetStereoProjectionMatrix (Camera.StereoscopicEye.Right, mRightCamera.projectionMatrix);

您需要更改代码:

mLeftCamera.SetStereoProjectionMatrices(mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
mRightCamera.SetStereoProjectionMatrices (mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
关于这一点:

mLeftCamera.SetStereoProjectionMatrix (Camera.StereoscopicEye.Left, mRightCamera.projectionMatrix);
mRightCamera.SetStereoProjectionMatrix (Camera.StereoscopicEye.Right, mRightCamera.projectionMatrix);

它在其他平台上运行吗?您使用的是哪个unity版本?这不是操作系统错误,您缺少Vuforia资产中的一些脚本或引用。我认为SetTereoProjectMatrix在最新的unity版本()中已过时,并且很可能Vuforia代码未相应更新。。但是如果不知道你使用的是什么unity版本,很难说100%:)我使用的是2018.1.6f1版本。那么,你有了它,要么寻找适用于2018.1.6f1的vuforia更新版本,要么降级unity,要么看看你是否可以自己修复vuforia源:)它在其他平台上运行吗?您使用的是哪个unity版本?这不是操作系统错误,您缺少Vuforia资产中的一些脚本或引用。我认为SetTereoProjectMatrix在最新的unity版本()中已过时,并且很可能Vuforia代码未相应更新。。但是如果不知道你使用的是什么unity版本,很难说100%:)我使用的是2018.1.6f1版本,那么你就有了它,要么寻找适用于2018.1.6f1的vuforia更新版本,要么降级unity,要么看看你是否可以自己修复vuforia源:)