유니티 IL2CPP 에러 - NullReferenceException: Object reference not set to an instance of an object
2023. 4. 2. 23:35ㆍUnity
유니티 NullReferenceException: Object reference not set to an instance of an object - System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor
유니티 IL2CPP 빌드 실행에서 나는 이 정체 불명의 에러의 정체는 ?! System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor
-> dynamic 키워드 때문이다. il2cpp에서는 dynamic 키워드를 쓰지 못한다. 당장 지워
NullReferenceException: Object reference not set to an instance of an object.
at System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Interpreter.LightLambda.GetRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Interpreter.LightLambda.MakeDelegate (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Expression`1[TDelegate].Compile (System.Boolean preferInterpretation) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.CallSite`1[T].MakeUpdateDelegate () [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.CallSite`1[T].GetUpdateDelegate (T& addr) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.CallSite`1[T]..ctor (System.Runtime.CompilerServices.CallSi
NullReferenceException: Object reference not set to an instance of an object.
at System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Interpreter.LightLambda.GetRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Interpreter.LightDelegateCreator.CreateDelegate () [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Expression`1[TDelegate].Compile (System.Boolean preferInterpretation) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.CallSite`1[T].MakeUpdateDelegate () [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.CallSite`1[T].GetUpdateDelegate (T& addr) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.CallSite`1[T]..ctor (System.Runtime.CompilerServices.CallSiteBinder binder) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.CallSite`1[T].Create (System.Runtime.CompilerServices.CallSiteBinder binder) [0x00000] in <00000000000000000000000000000000>:0
at DataAssetManager`1[T].Init (System.Object tableFromManager) [0x00000] in <00000000000000000000000000000000>:0
at RTS.GameManager.Awake () [0x00000] in <00000000000000000000000000000000>:0
스택 로그가 너무 어벙하게 떠서 실제 코드 위치를 찾기 힘들다.
평소에 코드 위치를 파악할 수 있는 로그가 없다면, IL2CPP 빌드에서 곤란한 에러를 겪게 될 것...