1
1

More than 3 years have passed since last update.

Unityで空のエラー

Last updated at Posted at 2020-08-31

現象

  • Unityで3Dプロジェクトを新規で作成すると、コンソールウィンドウにメッセージのないエラーがでる
  • この時、Editor.logに下記のエラーがでる(UnityEngine.TestRunner.dll以外にもコンパイルに失敗しているエラーが複数でる)
Editor.log
-----CompilerOutput:-stdout--exitcode: 137--compilationhadfailure: True--outfile: Temp/UnityEngine.TestRunner.dll
-----CompilerOutput:-stderr----------
Failed to initialize CoreCLR, HRESULT: 0x80004005
-----EndCompilerOutput---------------
  • この状態で、playmodeにしようとするとコンソールウィンドウに下記のエラーがでる
    "All compiler errors have to be fixed before you can enter playmode! UnityEditor.SceneView:ShowCompileErrorNotification() (at /Users/builduser/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:3652)"

環境

  • OS
    Mac OS Mojava 10.14.6
  • Unity Hub
    2.3.2
  • Unity
    2019.4.8f1 ※Unity Hub でインストール済み

原因

デフォルトで使っているCSCがよくないらしい

対処法

  • Unityが使っているCSC以外のCSCを探す
$ sudo find / 2> /dev/null | grep csc$
/Library/Frameworks/Mono.framework/Versions/6.12.0/bin/csc
/Library/Frameworks/Mono.framework/Versions/6.12.0/Commands/csc
/Applications/Unity/Hub/Editor/2019.4.8f1/Unity.app/Contents/Tools/Roslyn/csc

↑最後のやつがUnityが使っているCSC

  • デフォルトのCSCを他のCSCに置き換える
    /Applications/Unity/Hub/Editor/2019.4.8f1/Unity.app/Contents/Tools/RoslynScripts/unity_csc.sh を書き換える
unity_csc.sh
#CSC_NET_CORE=$APPLICATION_CONTENTS/Tools/Roslyn/csc
CSC_NET_CORE=/Library/Frameworks/Mono.framework/Versions/6.12.0/bin/csc

Unityが使っているcscをリネームして他のにエイリアスを貼ってもいけるかもしれないけど試してない。

参考URL

MacのUnityで空エラーがでた場合の対処方法(Unity2019.3.0f5)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1