Unity创建新项目时出现NullReferenceException。

huangapple go评论72阅读模式
英文:

Unity NullReferenceException when creating a new project

问题

在创建新项目时,我在Unity中遇到以下错误:

NullReferenceException:对象引用未设置为对象的实例
Unity.PlasticSCM.Editor.ProjectDownloader.ParseArguments.GetOrganizationNameFromData(System.String data)(位于Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/ParseArguments.cs:42)
Unity.PlasticSCM.Editor.ProjectDownloader.ParseArguments.CloudOrganization(System.Collections.Generic.Dictionary`2[TKey, TValue] args)(位于Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/ParseArguments.cs:24)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.DownloadRepository(System.String unityAccessToken,System.String[] commandLineArgs)(位于Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:63)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.DownloadRepository(System.String unityAccessToken)(位于Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:51)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.Execute(System.String unityAccessToken)(位于Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:43)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.RunOnceWhenAccessTokenIsInitialized()(位于Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:32)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions()(位于<e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
英文:

I get following error in Unity when creating a new project

NullReferenceException: Object reference not set to an instance of an object
Unity.PlasticSCM.Editor.ProjectDownloader.ParseArguments.GetOrganizationNameFromData (System.String data) (at Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/ParseArguments.cs:42)
Unity.PlasticSCM.Editor.ProjectDownloader.ParseArguments.CloudOrganization (System.Collections.Generic.Dictionary`2[TKey,TValue] args) (at Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/ParseArguments.cs:24)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.DownloadRepository (System.String unityAccessToken, System.String[] commandLineArgs) (at Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:63)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.DownloadRepository (System.String unityAccessToken) (at Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:51)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.Execute (System.String unityAccessToken) (at Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:43)
Unity.PlasticSCM.Editor.ProjectDownloader.CloudProjectDownloader.RunOnceWhenAccessTokenIsInitialized () (at Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs:32)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at &lt;e3d2e3f6a525465bbf8c67432a3cb6ef&gt;:0)

答案1

得分: 1

这个错误可能是由版本控制包引起的,请确保它已更新。

  • 要更新Unity项目中的版本控制包,请执行以下操作:

窗口 > 包管理器 > (在左上角确保你从包下拉菜单中选择了Unity Registry) > 搜索版本控制并更新它。

如果这不起作用,请尝试删除版本控制包,然后重新安装它。

英文:

This error is probably coming from the Version Control package make sure its updated

  • To update the version control package in your unity project

Window > Package Manager > (In the top left corner make sure you select Unity Registry from the packages drop down menu ) > Search for Version Control and update it

If this didn't work try deleting the version control package then install it again

答案2

得分: 1

也许是因为PlasticSCM(版本控制包)。

尝试在包管理器中卸载或更新它。

并且在创建项目时还可以取消选中版本控制开关。

希望能对你有所帮助。

英文:

Maybe it's because of PlasticSCM(Version Control package).

Try to uninstall or update it in Package Manager.

And also can uncheck the Version Control toggle when you create a project.

Hope it can help you.

答案3

得分: 0

以下是要翻译的内容:

  1. 关闭Unity编辑器,保持Unity Hub打开。
  2. 在Unity Hub中注销(左上角图标)。
  3. 登录Unity Hub。
  4. 启动Unity编辑器。
英文:

That happened to me some time ago. It's a "false" error. The problem is the login session token expired. Don't worry, refreshing it is easy.

  1. Close Unity Editor, keep Unity Hub open.
  2. Sign out of Unity Hub (left-top icon)
  3. Sign In Unity Hub
  4. Start Unity Editor

huangapple
  • 本文由 发表于 2023年5月22日 16:00:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76304107.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定