Fatal error in Unity CIL Linker 2017.2.0f3

We just moved over to the latest Unity build, to take advantage of the soon to be required marketing image for iOS, and we ran a set of builds and WebGL crashes, if we build on 2017.1 everything works, however with 2017.2 we get the following error.

Failed running C:\Program Files\Unity\Editor\Data\il2cpp/build/UnityLinker.exe --api=NET_2_0_Subset
-out="E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\tempStrip" -l=none -c=link --link-symbols
-x="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\Whitelists\Core.xml"
-f="C:\Program Files\Unity\Editor\Data\il2cpp\LinkerDescriptors"
-x "E:\Dev\Repos\gameclient/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml"
-x "E:\Dev\Repos\gameclient/Temp/StagingArea/Data/UnityEngine.xml"
-x "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\preserved_derived_types.xml"
-x "E:\Dev\Repos\gameclient\Assets\link.xml"
-x "E:\Dev\Repos\gameclient\Assets\FacebookSDK\link.xml"
-x "E:\Dev\Repos\gameclient\Assets\Plugins\UnityPurchasing\script\link.xml"
-d "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed"
-a  "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll"
-a  "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll"
-a  "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll"
-a  "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\DOTween.dll"
-a  "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\Facebook.Unity.Settings.dll"
-a  "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\TextMeshPro-1.0.55.2017.1.0b12.dll"
-a  "E:\Dev\Repos\gameclient\Temp\StagingArea\Data\Managed\UnityEngine.Analytics.dll"

stdout:
Fatal error in Unity CIL Linker
System.NullReferenceException: Object reference not set to an instance of an object.
   at UnityLinker.AddUnresolvedStubsStep.GetTypeModule(TypeReference type, AssemblyDefinition[] assemblies)
   at UnityLinker.AddUnresolvedStubsStep.Process()
   at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at UnityLinker.UnityDriver.Run()
   at UnityLinker.UnityDriver.RunDriver()
stderr:

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:89)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:82)
UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(String, IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:204)
UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:114)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:143)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:41)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Bug Report ID: 959923_05s5r1q67v8uq71v

This looks like a bug in Unity. Can you submit a bug report for this issue?

Hi, did ios build also failed ?
I got this error with ios build, no problem with 2017.1

Filed: 959923_05s5r1q67v8uq71v

1 Like

I am getting the same error with Cloud Build for iOS. I get this error for my current project. I tried with older projects and I also tried with a new empty project. The same error always : Fatal error in Unity CIL Linker

5834: [Unity] stdout:
5835: [Unity] Fatal error in Unity CIL Linker
5836: [Unity] System.NullReferenceException: Object reference not set to an instance of an object
5837: [Unity]   at UnityLinker.AddUnresolvedStubsStep.GetTypeModule (Mono.Cecil.TypeReference type, Mono.Cecil.AssemblyDefinition[] assemblies) [0x00001] in <81b71c29c35449f8a666455c78a2dcfb>:0
5838: [Unity]   at UnityLinker.AddUnresolvedStubsStep.GetTypeModule (Mono.Cecil.TypeReference type) [0x00001] in <81b71c29c35449f8a666455c78a2dcfb>:0
5839: [Unity]   at UnityLinker.AddUnresolvedStubsStep.Process () [0x000b5] in <81b71c29c35449f8a666455c78a2dcfb>:0
5840: [Unity]   at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x00018] in <09bca01fd71241c7a07af8c71eb6ae1a>:0
5841: [Unity]   at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00020] in <09bca01fd71241c7a07af8c71eb6ae1a>:0
5842: [Unity]   at UnityLinker.UnityDriver.Run () [0x00086] in <81b71c29c35449f8a666455c78a2dcfb>:0
5843: [Unity]   at UnityLinker.UnityDriver.RunDriverWithoutErrorHandling () [0x00001] in <81b71c29c35449f8a666455c78a2dcfb>:0
5844: [Unity]   at UnityLinker.UnityDriver.RunDriver () [0x00002] in <81b71c29c35449f8a666455c78a2dcfb>:0
5845: [Unity] stderr:
5846: [Unity] UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
5847: [Unity] UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
5848: [Unity] UnityEngine.Logger:Log(LogType, Object)
5849: [Unity] UnityEngine.Debug:LogError(Object)
5850: [Unity] UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
5851: [Unity] UnityEditor.CloudBuild.Builder:Build()
5852: [Unity] Exception: /UNITY_PATH/Unity/Unity-2017_2_0f3/Unity.app/Contents/il2cpp/build/UnityLinker.exe did not run properly!
5853: [Unity] UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
5854: [Unity] UnityEditor.CloudBuild.Builder:Build()

Same here. iOS build using to working fine since 5.x, even with 2017.1.1p4. Same error as above in 2017.2.0.f3 (MacOS High Sierra)

Same on android:

stdout:
Fatal error in Unity CIL Linker
System.NullReferenceException: Object reference not set to an instance of an object.
   at UnityLinker.AddUnresolvedStubsStep.GetTypeModule(TypeReference type, AssemblyDefinition[] assemblies)
   at UnityLinker.AddUnresolvedStubsStep.Process()
   at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at UnityLinker.UnityDriver.Run()
   at UnityLinker.UnityDriver.RunDriver()
stderr:

0x00000001411B000B (Unity) StackWalker::GetCurrentCallstack
0x00000001411B288F (Unity) StackWalker::ShowCallstack
0x000000014108CA30 (Unity) GetStacktrace
0x0000000140596DA3 (Unity) DebugStringToFile
0x0000000140597581 (Unity) DebugStringToFile
0x00000001412E85B2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x00000000350FB34B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
0x00000000350FB234 (Mono JIT Code) [DebugLogHandler.cs:9] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x00000000350FAB35 (Mono JIT Code) [Logger.cs:47] UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000000350FA853 (Mono JIT Code) [DebugBindings.gen.cs:124] UnityEngine.Debug:LogError (object)
0x00000000350F9284 (Mono JIT Code) [BuildUtils.cs:128] UnityEditorInternal.Runner:RunProgram (UnityEditor.Utils.Program,string,string,string,UnityEditor.Scripting.Compilers.CompilerOutputParserBase)
0x00000000350F85D8 (Mono JIT Code) [BuildUtils.cs:73] UnityEditorInternal.Runner:RunManagedProgram (string,string,string,UnityEditor.Scripting.Compilers.CompilerOutputParserBase,System.Action`1<System.Diagnostics.ProcessStartInfo>)
0x00000000350F7FD1 (Mono JIT Code) [AssemblyStripper.cs:89] UnityEditorInternal.AssemblyStripper:RunAssemblyLinker (System.Collections.Generic.IEnumerable`1<string>,string&,string&,string,string)
0x00000000350F61D0 (Mono JIT Code) [AssemblyStripper.cs:82] UnityEditorInternal.AssemblyStripper:StripAssembliesTo (string[],string[],string,string,string&,string&,string,UnityEditorInternal.IIl2CppPlatformProvider,System.Collections.Generic.IEnumerable`1<string>)
0x00000000350EBCEE (Mono JIT Code) [AssemblyStripper.cs:204] UnityEditorInternal.AssemblyStripper:RunAssemblyStripper (string,System.Collections.IEnumerable,string,string[],string[],string,UnityEditorInternal.IIl2CppPlatformProvider,UnityEditor.RuntimeClassRegistry)
0x00000000350E9213 (Mono JIT Code) [AssemblyStripper.cs:114] UnityEditorInternal.AssemblyStripper:StripAssemblies (string,UnityEditorInternal.IIl2CppPlatformProvider,UnityEditor.RuntimeClassRegistry)
0x00000000350E8C2A (Mono JIT Code) [AssemblyStripper.cs:313] UnityEditorInternal.AssemblyStripper:InvokeFromBuildPlayer (UnityEditor.BuildTarget,UnityEditor.RuntimeClassRegistry)
0x00000000350C486B (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_object (object,intptr,intptr,intptr)
0x00007FF9D2B660FB (mono) [mini.c:4937] mono_jit_runtime_invoke
0x00007FF9D2AB8875 (mono) [object.c:2623] mono_runtime_invoke
0x000000014091D03C (Unity) scripting_method_invoke
0x00000001409119C3 (Unity) ScriptingInvocation::Invoke
0x0000000140A93E18 (Unity) BuildPlayerScriptDLLs
0x0000000140AA5AF8 (Unity) BuildPlayerData
0x0000000140AA7D01 (Unity) DoBuildPlayer_Build
0x0000000140AA7DC3 (Unity) DoBuildPlayer
0x0000000140AA8CA6 (Unity) BuildPlayer
0x00000001411EF811 (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
0x0000000032B96ED7 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool)
0x0000000032B966B0 (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:155] UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
0x0000000032B911EF (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:83] UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x0000000032B90BBC (Mono JIT Code) [BuildPlayerWindow.cs:173] UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool)
0x000000003194C98A (Mono JIT Code) [BuildPlayerWindow.cs:875] UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform)
0x000000003193C441 (Mono JIT Code) [BuildPlayerWindow.cs:795] UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
0x000000003190842D (Mono JIT Code) [BuildPlayerWindow.cs:420] UnityEditor.BuildPlayerWindow:OnGUI ()
0x0000000000767412 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FF9D2B660FB (mono) [mini.c:4937] mono_jit_runtime_invoke
0x00007FF9D2AB8875 (mono) [object.c:2623] mono_runtime_invoke
0x00007FF9D2ABED83 (mono) [object.c:3838] mono_runtime_invoke_array
0x00007FF9D2A7D217 (mono) [icall.c:2750] ves_icall_InternalInvoke
0x0000000000730AB7 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
0x000000000072EC12 (Mono JIT Code) [MonoMethod.cs:222] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
0x0000000000811E4F (Mono JIT Code) [MethodBase.cs:115] System.Reflection.MethodBase:Invoke (object,object[])
0x000000003047E7B5 (Mono JIT Code) [HostView.cs:285] UnityEditor.HostView:Invoke (string,object)
0x000000003047E65A (Mono JIT Code) [HostView.cs:278] UnityEditor.HostView:Invoke (string)
0x0000000031900A91 (Mono JIT Code) [HostView.cs:107] UnityEditor.HostView:OldOnGUI ()
0x00000000318F04F1 (Mono JIT Code) [IMGUIContainer.cs:127] UnityEngine.Experimental.UIElements.IMGUIContainer:smile:oOnGUI (UnityEngine.Event)
0x00000000318C304C (Mono JIT Code) [IMGUIContainer.cs:213] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent (UnityEngine.Experimental.UIElements.EventBase)
0x00000000305F8BA6 (Mono JIT Code) [EventDispatcher.cs:182] UnityEngine.Experimental.UIElements.EventDispatcher:smile:ispatchEvent (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.BaseVisualElementPanel)
0x00000000305D94AF (Mono JIT Code) [UIElementsUtility.cs:207] UnityEngine.Experimental.UIElements.UIElementsUtility:smile:oDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel)
0x00000000305D8F7B (Mono JIT Code) [UIElementsUtility.cs:72] UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent (int,intptr)
0x00000000305D8A9D (Mono JIT Code) [GUIUtility.cs:175] UnityEngine.GUIUtility:ProcessEvent (int,intptr)
0x00000000305D8C5E (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr)
0x00007FF9D2B660FB (mono) [mini.c:4937] mono_jit_runtime_invoke
0x00007FF9D2AB8875 (mono) [object.c:2623] mono_runtime_invoke
0x000000014091D03C (Unity) scripting_method_invoke
0x00000001409119C3 (Unity) ScriptingInvocation::Invoke
0x000000014091213A (Unity) ScriptingInvocation::Invoke<bool>
0x00000001401326AE (Unity) IMGUIScriptingClasses::ProcessEvent
0x00000001410050A6 (Unity) GUIView::ProcessRetainedMode
0x00000001412B849A (Unity) GUIView::OnInputEvent
0x0000000140FFF3D3 (Unity) GUIView::ProcessInputEvent
0x00000001412B0575 (Unity) GUIView::ProcessEventMessages
0x00000001412BC39A (Unity) GUIView::GUIViewWndProc
0x00007FFA169DBC50 (USER32) CallWindowProcW
0x00007FFA169DB5CF (USER32) DispatchMessageW
0x00000001412CC2EA (Unity) MainMessageLoop
0x00000001412CDC04 (Unity) WinMain
0x0000000141DE45A8 (Unity) __tmainCRTStartup
0x00007FFA162F2774 (KERNEL32) BaseThreadInitThunk
0x00007FFA16CF0D51 (ntdll) RtlUserThreadStart

Same problem when building through Jenkins for both iOS and Android on mac build slaves with Unity 2017.2.0.f3. Any workarounds or Unity patches that help with the problem?

Same here. 2017.2.0.f3 :frowning:

We’ve not tracked down the cause of this issue yet. If anyone else can submit a bug report with a project that causes this issue, that would help. The more projects we can look at, the better chance we have of tracking down the cause of this issue.

I use High Sierra too. Are you all using High Sierra? It may be related to this issue…

I fixed it by reimporting Unity IAP in Services tab.

2 Likes

Im also using high Sierra. But it still fails :confused:

I’m using sierra (and cloud build), I’ll try with iap update later today.

Thank you for your information.
I was able to fix this error.

unity 2017.2.0f3
macOS Sierra

Same here, updating unity IAP fix this issue
unity 2017.2.0f3
macOS High Sierra

Same here but updating Unity IAP and reimporting it several times didn’t solve my problem.

Platform : Android
Unity version : 2017.2.0f3
NDK version : r13b
Windows 7

I submited a bug report : 962771_9vv6blinqsgtifop

I’m having the same issue on building for iOS. I have tried the following:

  • Removing link.xml files (in case they are referencing libraries that are not in the project)
  • Downloading a fresh copy of the code from Collab
  • Restoring to older revisions
  • Disabling “strip engine code”
  • Setting API Compatibility to .NET 2.0
  • Cloud build (2017.2.0f3)
  • Building on the Windows
  • Tweaking the link XMLs

Nothing works except for cloud build with 2017.1.
New empty project builds fine. It still builds fine after turning on Services. It fails as soon as you add In-app purchasing from Unity Services.

Same issue here when building for android

Failed running X:\UntiyInstalled\Editor\Data\il2cpp/build/UnityLinker.exe --api=NET_2_0_Subset -out="x:\zzz\xxx\mygame\Temp\StagingArea\Data\Managed\tempStrip" -l=none -c=link --link-symbols -x="x:\UntiyInstalled\Editor\Data\PlaybackEngines\AndroidPlayer\Whitelists\Core.xml" -f="x:\UntiyInstalled\Editor\Data\il2cpp\LinkerDescriptors" -x

I could fix this issue by disabling Stripping level. FYI im using UNITY’s IAP , FB SDK version 7.10.0 and my unity’s version is 2017.2.0f3.
If someone finds a work around please post it here.Thank you