Hello,
I found several threads about build errors with IL2CPP backend, but the error mesages are different. I do not have a good understanding what is going wrong during the build process.
Problem: With an new and empty project, regardless of selected platform, all builds with IL2CPP backend fail with the same error message
type “Mono.Cecil.GenericParameterConstraint” in assembly “Mono.Cecil, Version=0.10.0.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e” could not be loaded
A Standalone / Mono build works. I am posting in the Android forum because it was my first build that failed before I tried other platforms with IL2CPP.
- Fresh install of Unity 2019.4.17f1 LTS.
- JDK, Android SDK Tools and Android NDK were installed during installation of 2019.4.17 by Unity Hub.
- Visual Studio Pro 2019 16.8.2 is installed (including C++ for desktop and game development).
- Windows SDK 10.0.18362.0 is installed
Exception: C:\Program Files\Unity\Hub\Editor\2019.4.17f1\Editor\Data\il2cpp\build/deploy/net471/UnityLinker.exe did not run properly!
Failed running “C:\Program Files\Unity\Hub\Editor\2019.4.17f1\Editor\Data\il2cpp\build/deploy/net471/UnityLinker.exe” @L:/_PROJECTS/_UNITY/UGS/Temp/StagingArea/assets/bin/Data/Managed/response.rsp
stdout:
Fatal error in Unity CIL Linker
System.TypeLoadException: Der Typ “Mono.Cecil.GenericParameterConstraint” in der Assembly “Mono.Cecil, Version=0.10.0.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e” konnte nicht geladen werden.
bei Mono.Linker.Steps.MarkStep.MarkGenericParameter(GenericParameter parameter)
bei Mono.Linker.Steps.MarkStep.MarkGenericParameterProvider(IGenericParameterProvider provider)
bei Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
bei Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
bei Mono.Linker.Steps.MarkStep.MarkFields(TypeDefinition type, Boolean includeStatic, Boolean markBackingFieldsOnlyIfPropertyMarked)
bei Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
bei Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
bei Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkRequiredByNativeMember(ICustomAttributeProvider required)
bei Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkRequiredByNativeMembers(EngineModule module)
bei Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkModule(EngineModule module, Boolean markEngineModule)
bei Unity.Linker.Steps.Marking.EngineStrippingMarking.Initialize()
bei Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
bei Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
bei Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
bei Mono.Linker.Pipeline.Process(LinkContext context)
bei Unity.Linker.UnityDriver.Run()
bei Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling()
bei Unity.Linker.UnityDriver.RunDriver()
stderr:
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <2f1c602eae0d45c293fff3e3aef759fa>:0) UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable
1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String outputFolder, System.String& output, System.String& error, System.Collections.Generic.IEnumerable1[T] linkXmlFiles, UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <2f1c602eae0d45c293fff3e3aef759fa>:0) UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <2f1c602eae0d45c293fff3e3aef759fa>:0) UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.BaseUnityLinkerPlatformProvider unityLinkerPlatformProvider, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at <2f1c602eae0d45c293fff3e3aef759fa>:0) UnityEditorInternal.IL2CPPBuilder.Run () (at <2f1c602eae0d45c293fff3e3aef759fa>:0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action
1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)