- Home /
Unity 2017.1 IL2CPP for Android "UnityLinker.exe did not run properly!"
Hi! I have got a problem with compilation for il2cpp. What is strange that il2cpp works for IOS, but not for Android. Posting below error info: Failed running /Applications/Unity/Unity.app/Contents/il2cpp/build/UnityLinker.exe --api=NET_2_0 -out="/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/tempStrip" -l=none -c=link --link-symbols -x="/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Core.xml" -f="/Applications/Unity/Unity.app/Contents/il2cpp/LinkerDescriptors" -x "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/../platform_native_link.xml" -x "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/methods_pointedto_by_uievents.xml" -x "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/preserved_derived_types.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/AI.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Animation.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Audio.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Cloth.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Core.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/CrashReporting.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Director.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/GameCenter.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/IMGUI.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/ImageConversion.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Input.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/JSONSerialize.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/ParticleSystem.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/ParticlesLegacy.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/PerformanceReporting.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Physics.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Physics2D.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/ScreenCapture.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/SpriteMask.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/StyleSheets.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Terrain.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/TerrainPhysics.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/TextRendering.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UI.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UIElements.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UNET.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UnityAnalytics.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UnityConnect.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UnityWebRequest.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UnityWebRequestAudio.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UnityWebRequestTexture.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/UnityWebRequestWWW.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/VR.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Vehicles.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Video.xml" -x "/Applications/Unity/PlaybackEngines/AndroidPlayer/Whitelists/Web.xml" -x "/Users/patryksladek/etabuunity/Assets/link.xml" -x "/Users/patryksladek/etabuunity/Assets/FacebookSDK/link.xml" -x "/Users/patryksladek/etabuunity/Assets/Scripts/link.xml" -d "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/Assembly-CSharp-firstpass.dll" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/Assembly-CSharp.dll" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/UnityEngine.Advertisements.dll" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/UnityEngine.UI.dll" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/UnityEngine.Analytics.dll" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/DOTween.dll" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/Facebook.Unity.dll" -a "/Users/patryksladek/etabuunity/Temp/StagingArea/assets/bin/Data/Managed/TextMeshPro-1.0.55.2017.1.0b11.dll"
stdout: Fatal error in Unity CIL Linker System.NullReferenceException: Object reference not set to an instance of an object at Mono.Linker.Utilities+c_Iterator1.MoveNext () [0x00039] in :0 at Mono.Linker.Steps.TypeMapStep.TryMatchMethod (Mono.Cecil.TypeReference type, Mono.Cecil.MethodDefinition method) [0x00034] in :0 at Mono.Linker.Steps.TypeMapStep+c_Iterator0.MoveNext () [0x00069] in :0 at Mono.Linker.Steps.TypeMapStep.MapVirtualInterfaceMethod (Mono.Cecil.MethodDefinition method) [0x00022] in :0 at Mono.Linker.Steps.TypeMapStep.MapVirtualMethod (Mono.Cecil.MethodDefinition method) [0x00008] in :0 at Mono.Linker.Steps.TypeMapStep.MapVirtualMethods (Mono.Cecil.TypeDefinition type) [0x0003c] in :0 at Mono.Linker.Steps.TypeMapStep.MapType (Mono.Cecil.TypeDefinition type) [0x00001] in :0 at Mono.Linker.Steps.TypeMapStep.ProcessAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00020] in :0 at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x00031] in :0 at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00025] in :0 at UnityLinker.UnityDriver.Run () [0x00087] in :0 at UnityLinker.UnityDriver.RunDriverWithoutErrorHandling () [0x00001] in :0 at UnityLinker.UnityDriver.RunDriver () [0x00002] in :0 stderr:
UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73) UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:89) UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:82) UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(String, IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:200) UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:114) UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:143) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:34) UnityEditor.HostView:OnGUI() Thanks for your help!
This looks like a bug in Unity. Can you submit a bug report?
Answer by hpidcock · Nov 14, 2017 at 04:53 AM
Took a while for me to debug this in our project. (Building with 2017.2.0f3 64bit on Windows targeting Android)
If a call to UnityEngine.iOS.Device.SetNoBackupFlag for example is present on Android in any assembly, it will cause il2cpp's UnityLinker to crash. Even if a call never happens at runtime.
Since UnityEngine.dll is a monolithic assembly that provides functionality for all platforms, it shouldn't result in compilation/build pipeline errors when you have a call to platform specific functionality. If a call exists to one of these platform specific methods, the method should be stubbed out and throw a not implemented exception.
Your description of what should happen is correct. This looks like a bug in UnityLinker. Can you submit a bug report and include a project that causes this issue?
Hello there, I'm trying to build .aab file for Android, but I cannot because of UnityLinker.exe error. I use Unity 2019.3 il2cpp and net.x.4. Could you please help me)
Answer by Only4gamers · Jun 30, 2020 at 12:46 PM
Did you find the solution? I am facing similar issue.
Your answer
Follow this Question
Related Questions
Android build crash - stack corruption detected Unity 2018.3.8f1 2 Answers
Has anyone downloaded and loaded .so files manually with any soLoader, to reduce the apk size? 0 Answers
Error while building APK (IL2CPP)- Failed to link 'libunity.so'. 0 Answers