- Home /
Calling SetScriptingDefineSymbolsForGroup in batchmode
As part of our build process we update the script defines by calling UnityEditor.PlayerSettings:SetScriptingDefineSymbolsForGroup. This works fine, but Unity emits an error log saying:
Reload Assembly called from managed code directly. This will cause a crash. You should never refresh assets in synchronous mode or enter playmode synchronously from script code.
While normally this doesn't cause a problem, we do occasionally have a crash during the build. Obviously I'd prefer to have a way to prevent spurious crashes and to that end how can I have a build process modify scripting defines without triggering that ominous crash log?
Native stacktrace:
0 libmonobdwgc-2.0.dylib 0x00000001308aabff mono_handle_native_crash + 242
1 libsystem_platform.dylib 0x00007fffb89a6b3a _sigtramp + 26
2 ??? 0x0000000000008720 0x0 + 34592
3 libsystem_c.dylib 0x00007fffb882b420 abort + 129
4 libmonobdwgc-2.0.dylib 0x0000000130a53550 GC_noop6 + 0
5 libmonobdwgc-2.0.dylib 0x0000000130a27afb mono_unity_liveness_calculation_begin + 26
6 Unity 0x0000000100cfa19c _Z26GarbageCollectSharedAssetsb + 1436
7 Unity 0x0000000100e1eb55 _ZN27UnloadUnusedAssetsOperation19IntegrateMainThreadEv + 21
8 Unity 0x0000000100e1c8f2 _ZN14PreloadManager26UpdatePreloadingSingleStepENS_21UpdatePreloadingFlagsEi + 530
9 Unity 0x0000000100e1d44c _ZN14PreloadManager35WaitForAllAsyncOperationsToCompleteEv + 172
10 Unity 0x000000010276ef61 _ZN14AssetInterface27ProcessAssetsImplementationERd15CancelBehaviourN13AssetDatabase18UpdateAssetOptionsE + 1729
11 Unity 0x000000010276b7ce _ZN14AssetInterface16StopAssetEditingE15CancelBehaviourN13AssetDatabase18UpdateAssetOptionsE + 494
12 Unity 0x0000000102769295 _ZN14AssetInterface7RefreshEN13AssetDatabase18UpdateAssetOptionsE + 12629
13 Unity 0x0000000102722138 _ZN13AssetDatabase7RefreshENS_18UpdateAssetOptionsE + 232
14 Unity 0x0000000101b2c3c5 _ZN11Application17InitializeProjectEv + 11029
15 Unity 0x000000010074a139 _Z14NoGraphicsMainv + 41
16 Unity 0x000000010074a4ca _Z10EditorMainiPPKc + 826
17 Unity 0x000000010074a959 main + 9
18 libdyld.dylib 0x00007fffb8797235 start + 1
I had another issue. If I define symbol like this in the batch mode command, I am not able to go in that symbol define preprocessor code block in the first attempt. Have you encountered this? Or solved it?
Your answer
Follow this Question
Related Questions
batchmode consumes 100% cpu 2 Answers
Unity crashes when called from script/daemon 2 Answers
HideFlags not respected in batch mode 0 Answers
batchmode and screenshots. 0 Answers
Why is Unity.exe crashing while running -batchmode? 0 Answers