如何修复Unity中的“不允许包含或不能包含UnityyEngine.UI.dll”的问题?

时间:2019-05-25 22:35:03

标签: dll unity3d

即使在项目为空的情况下,此错误也会在Build上发生:

ArgumentException: The Assembly UnityEditor is referenced by UnityEngine.UI ('F:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:150)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:190)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

我曾尝试按照某些论坛和堆栈溢出问题中的建议更改Api兼容性级别,但似乎无济于事。

1 个答案:

答案 0 :(得分:1)

好像没有获得UnityEditor.dll的任何引用,请尝试将其添加为依赖项。