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

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

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

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

没法用常规方法定位

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

(*其实解决方法就是把多余的package删掉,几乎都是在/Library目录,可放心删除,定位方法如下)

方法一:

工作多年居然不知道解决方法是:有查看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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

avi9111

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值