You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

重新安装Unity 2021.3.4f1编辑器后项目无法正常构建的问题求助

重新安装Unity 2021.3.4f1编辑器后项目无法正常构建的问题求助

我之前有个项目构建完全正常,但后来不得不重新安装Unity,并且下载了我之前使用的特定版本编辑器(2021.3.4f1)。现在我的项目要么构建失败,要么构建完成后场景出现画面抖动的异常情况。一开始我以为是某个场景文件损坏,替换之后才发现,那些从八月份起就没改动过、之前构建完全正常的旧分支版本也出现了构建问题。

我已经尝试了以下操作:

  • 替换疑似损坏的场景,但没有效果,构建后的场景依然抖动甚至会崩溃
  • 打开之前确认没问题的旧分支版本,有的直接构建失败,有的同样出现画面抖动问题,还有的是其他场景出现异常

控制台输出的错误信息如下:

Unity构建核心错误

UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <36f62d8e760b48f7af5d32916f997ce1>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <36f62d8e760b48f7af5d32916f997ce1>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Android Gradle相关警告与错误

Configure project :launcher

WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8

Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':launcher:sdkReleaseDependencyData'.
Could not initialize class javax.crypto.JceSecurity

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 2s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

尝试用新版本编辑器打开项目的错误

后来我尝试用新版本编辑器打开这个项目,结果只能以安全模式打开,还出现了2个致命错误:

  • Assets\Oculus\VR\Editor\OVRDeviceSelector.cs(45,20): error CS1061: 'OculusSettings' does not contain a definition for 'TargetQuest' and no accessible extension method 'TargetQuest' accepting a first argument of type 'OculusSettings' could be found (are you missing a using directive or an assembly reference?)
  • 提示Unloading broken assembly Library/ScriptAssemblies/Unity.Rider.Editor.dll, this assembly can cause crashes in the runtime

ADB相关错误

另外还出现了ADB的错误提示:

Multiple ADB server instances found, the following ADB server instance have been terminated due to being run from another SDK. Process paths:
C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe

现在我有点懵了,想问问大家,是不是我现在用的这个2021.3.4f1编辑器本身有问题?

备注:内容来源于stack exchange,提问作者MirjaKop

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 09:34:32