はじめに
久しぶりにUnity触ろうと新規プロジェクト作成しようとしたができなかった。
解決にちょっと悩んだので備忘録。
症状
具体的にはFile -> New Project -> Create project
としてもプロジェクトが作成されず、Unityが死んだまま再起動もされない。
また、Unity -> Preferences
から設定を変更してUnityを再起動しても設定が保存されていない。
環境
- Unity 2018.2.3f1, 2018.2.20f1
- Rider 2018.2.3
2つのバージョンのUnityで試したけど両方ダメだった。
エラー内容
$ tail -f ~/Library/Logs/Unity/Editor.log
...
Refresh: detecting if any assets need to be imported or removed ...
Refresh: elapses 0.017180 seconds (Nothing changed)
Refresh completed in 0.017242 seconds.
Refresh: detecting if any assets need to be imported or removed ...
Refresh: elapses 0.016770 seconds (Nothing changed)
Refresh completed in 0.016825 seconds.
[Package Manager] Server::Kill -- Server was shutdown
Cleanup mono
get_unityVersion is not allowed to be called while application is terminating.
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Scripting/ScriptingThreadAndSerializationSafeCheck.cpp Line: 85)
Unhandled Exception: UnityEngine.UnityException: get_unityVersion is not allowed to be called while application is terminating.
at <0x00000>
at <0x00000>
at <0x00000>
at <0x00000>
at <0x00000>
at <0x00000>
at <0x00000>
Unhandled Exception: UnityEngine.UnityException: get_unityVersion is not allowed to be called while application is terminating.
この部分を読む限りだと終了時に異常が起きていて正しく終了できていないように見える。
なので設定を変更して終了しても変更が保存される前に死ぬのでは。
エラーの原因
エラーでググった。
IVANSHAKHOVJAN 04, 2019 12:37
I can reproduce it with Rider EditorPlugin.
Riderのプラグインが原因らしい。
解決方法(WIP)
-
Assets -> Plugins -> Editor -> JetBrains
をディレクトリごと削除 - Unityを終了(まだエラー出て死ぬ)
- Unityを起動
- Unityを終了(エラーが出ずに正しく終了)
でとりあえず解決。
でもRider使えないと困るので、Riderを開いて再度プラグインをインストール。
インストール完了後、以下のポップアップが出た。
Rider plugin v2018.2.0.104 can be found at: Assets\Plugins\Editor\JetBrains\JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.
これでUnityを終了すると再度同じエラーが出たので、根本的な解決にはならなかった。
Riderのバージョンとか上げたらいいんだろうか。また後で試す。