当前位置:   article > 正文

Unity打开新项目报错_unityeditor.sceneview:showcompileerrornotification

unityeditor.sceneview:showcompileerrornotification()

如下图所示,第一次打开项目的时候报错,
在这里插入图片描述

内容大致为:
FileNotFoundException: Could not find file “D:\GithubProjects\Navigation\VoxelWorldandAstarRoadGenerator\Voxel-World-and-A-star-Road-Generator\Voxel World and A-star Road Generator\Library\PackageCache\com.unity.analytics@3.2.2\Tests\Editor\Unity.Analytics.StandardEvents\Unity.Analytics.StandardEvents.EditorTests.asmdef”.
System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:305)
System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:363)
System.IO.StreamReader…ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:167)

神奇的是,可以按Clear清除掉Console里的内容,就不会报错了,然而点击Play后会有新的报错,但是有没有提示具体问题出在哪里,如下图所示:

在这里插入图片描述
报错内容如下:
All compiler errors have to be fixed before you can enter playmode!
UnityEditor.SceneView:ShowCompileErrorNotification()

如果重新打开Unity,仍然会发现第一个图所示的报错,这就很神奇。

解决办法
根据错误提示FileNotFoundException: Could not find file,应该是文件路径太长了,导致Unity找不到,我的路径有这么长

D:\GithubProjects\Navigation\VoxelWorldandAstarRoadGenerator\Voxel-World-and-A-star-Road-Generator\Voxel World and A-star Road Generator
  • 1

于是直接把项目移到D盘,发现可以正常运行了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/81162?site
推荐阅读
相关标签
  

闽ICP备14008679号