Unity更新插件提示后the same name nunit.framework unity项目一直不能运行

Posted avi9111

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unity更新插件提示后the same name nunit.framework unity项目一直不能运行相关的知识,希望对你有一定的参考价值。

最近在做一个旧项目,是Unity5,没法升级,但是因为加了一些pack,就死活compile出错了

是C#代码(内部)出错,项目一直跑不起来了

出错的提示是很怪,说unit.framework重复了,这个框架本是C#框架,和unity关系不大,

没法用常规方法定位

未必完全是下面的错误提示,但问题是一样的,都是更新包后莫名出错了

方法一:

工作多年居然不知道解决方法是:有查看update log的方法,特别是下面第二个方法,很好用

我查到的log如下

=== Sun Jan  8 01:52:25 2023

Packages were changed.
Update Mode: mergeDefaultDependencies

The following packages were added:
  com.unity.animation.rigging@1.1.1
  com.unity.inputsystem@1.3.0
  com.unity.test-framework@1.1.33
  com.unity.ugui@1.0.0
  com.unity.modules.androidjni@1.0.0
The following packages were updated:
  com.unity.textmeshpro from version 1.4.1 to 3.0.6

网上找的错误提示

===================================

PrecompiledAssemblyException: Multiple precompiled assemblies with the same name Mono.Cecil.dll included for the current platform. Only one assembly with the same name is allowed per platform. Assembly path: 0

UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.CreateTargetAssemblies (System.Collections.Generic.IEnumerable1[T] customScriptAssemblies, System.Collections.Generic.IEnumerable1[T] precompiledAssemblies) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorBuildRules.cs:221)

UnityEditor.Scripting.ScriptCompilation.EditorCompilation.UpdateCustomTargetAssemblies () (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:672)

UnityEditor.Scripting.ScriptCompilation.EditorCompilation.SetAllCustomScriptAssemblyJsonContents (System.String[] paths, System.String[] contents, System.String[] guids) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:892)

UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.SetAllCustomScriptAssemblyJsonContents (System.String[] allAssemblyJsonPaths, System.String[] allAssemblyJsonContents, System.String[] guids) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:241)

======================================================

解决方案如下

1:打开packages manager ,在window->packages Manager。然后把能升级的package 都升级了。应该就解决了

如果找不到Packages Manager

2: (1) 打开项目目录下的 Logs->Packages-Update.log。 看看都更新了什么package。

(2) 打开项目目录下的Packages->manifest.json。 备份里面的内容,然后删除unity升级时加的package。

(3)重启unity,这个时候错误应该消失了。

(4)打开packages manager ,在window->packages Manager。然后把能升级的package 都升级了。

(5)把第二部删除的package添加回来

(6)重启unity

方法二:

直接看log的实体。。。。。。。。。。。。。。

发现又是Packagecache的问题(为什么用又呢?)

PrecompiledAssemblyException: Multiple precompiled assemblies with the same name nunit.framework.dll included or the current platform. Only one assembly with the same name is allowed per platform. Assembly paths: 
C:/Program Files/Unity/Hub/Editor/2018.4.36f1/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll
D:/360Downloads/AquaMan SellMYApp/Library/PackageCache/com.unity.ext.nunit@1.0.6/net35/unity-custom/nunit.framework.dll

以上是关于Unity更新插件提示后the same name nunit.framework unity项目一直不能运行的主要内容,如果未能解决你的问题,请参考以下文章

关于本地用svn up的时候报cannot update svn folder: "unversioned directory of the same name already exists

Mysql启动时提示:Another MySQL daemon already running with the same unix socket.

webserviceTwo classes have the same XML type name(转)

Hibernate更新数据报错:a different object with the same identifier value was already associated with the se

A new node couldn't be inserted because one with the same name exists. (VERR_CFGM_NODE_EXISTS).(

UnityError The same field name is serialized multiple times in the class or its parent class. This