- Home /
WebGL Build Error: IL2CPP error
We've mostly built for Windows until now and had no issues. After switching to build for WebGL and changing the Api Compatibility Level to .NET 2.0, we are getting the following errors while IL2CPP attempts to strip unused code. Is anyone able to help? I'd be very grateful!
The first error seems fairly useless:
IL2CPP error for type 'System.MonoType' in MonoType.cs:67
Additional information: Invalid method 'System.Boolean System.Type::op_Equality(System.Type,System.Type)' found in vtable for 'System.MonoType'
The second error seems a bit more helpful:
Failed running C:\Program Files\Unity\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --development-mode --compile-cpp --libil2cpp-static --platform="WebGL" --architecture="EmscriptenJavaScript" --configuration="Release" --outputpath="C:\Users\Jake\Documents\Test Project 5.20.2018\Assets /../Temp/StagingArea/Data\Native\build.bc" --cachedirectory="C:\Users\Jake\Documents\Test Project 5.20.2018\Assets\..\Library/il2cpp_cache" --compiler-flags="-Oz -DIL2CPP_EXCEPTION_DISABLED=1 " --emit-method-map --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AccessibilityModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AIModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AnimationModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ARModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AssetBundleModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AudioModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_BaselibModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ClothModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_CloudWebServicesModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_CoreModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_CrashReportingModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_DirectorModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_FacebookModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_GameCenterModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_GridModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_HotReloadModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ImageConversionModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_IMGUIModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_InputModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_JSONSerializeModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ParticlesLegacyModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ParticleSystemModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_PerformanceReportingModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_Physics2DModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_PhysicsModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ScreenCaptureModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SharedInternalsModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SpatialTrackingModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SpriteMaskModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SpriteShapeModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_StyleSheetsModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SubstanceModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TerrainModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TerrainPhysicsModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TextRenderingModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TilemapModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TimelineModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TLSModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UIElementsModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UIModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UmbraModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UNETModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityAnalyticsModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityConnectModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestAssetBundleModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestAudioModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestTextureModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestWWWModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_VehiclesModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_VideoModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_VRModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_WebGLModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_WebModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_WindModule_Dynamic.bc" --additional-libraries="C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_XRModule_Dynamic.bc" --map-file-parser="C:\Program Files\Unity\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\UnityEngine.Networking.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\UnityEngine.Analytics.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\I18N.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\I18N.MidEast.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\I18N.Other.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\I18N.Rare.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\I18N.West.dll" --assembly="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\Managed\UnityEngine.dll" --generatedcppdir="C:\Users\Jake\Documents\Test Project 5.20.2018\Temp\StagingArea\Data\il2cppOutput"
stdout:
IL2CPP error for type 'System.MonoType' in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoType.cs:67
Additional information: Invalid method 'System.Boolean System.Type::op_Equality(System.Type,System.Type)' found in vtable for 'System.MonoType'
il2cpp.exe didn't catch exception: System.Exception: Invalid method 'System.Boolean System.Type::op_Equality(System.Type,System.Type)' found in vtable for 'System.MonoType'
at Unity.IL2CPP.Metadata.VTableBuilder.ValidateAllMethodSlots(TypeDefinition typeDefinition, IEnumerable`1 slots)
at Unity.IL2CPP.Metadata.VTableBuilder.VTableForType(TypeDefinition typeDefinition, Dictionary`2 interfaceOffsets, Int32 currentSlot)
at Unity.IL2CPP.Metadata.VTableBuilder.VTableFor(TypeReference typeReference, TypeResolver resolver)
at Unity.IL2CPP.Metadata.VTableBuilder.IndexFor(MethodDefinition method)
at Unity.IL2CPP.MethodBodyWriter.VirtualCallFor(IGeneratedMethodCodeWriter writer, MethodReference method, MethodReference unresolvedMethod, IEnumerable`1 args, TypeResolver typeResolver, IRuntimeMetadataAccess runtimeMetadataAccess, VTableBuilder vTableBuilder)
at Unity.IL2CPP.MethodBodyWriter.GetMethodCallExpression(IGeneratedMethodCodeWriter writer, MethodReference callingMethod, MethodReference methodToCall, MethodReference unresolvedMethodtoCall, TypeResolver typeResolverForMethodToCall, MethodCallType callType, IRuntimeMetadataAccess runtimeMetadataAccess, VTableBuilder vTableBuilder, IEnumerable`1 argumentArray, Boolean useArrayBoundsCheck, Func`2 addUniqueSuffix)
at Unity.IL2CPP.MethodBodyWriter.CallExpressionFor(MethodReference callingMethod, MethodReference unresolvedMethodToCall, MethodCallType callType, List`1 poppedValues, Func`2 addUniqueSuffix, Boolean emitNullCheckForInvocation)
at Unity.IL2CPP.MethodBodyWriter.ProcessInstruction(Node node, InstructionBlock block, Instruction& ins)
at Unity.IL2CPP.MethodBodyWriter.GenerateCodeRecursive(Node node)
at Unity.IL2CPP.MethodBodyWriter.Generate()
at Unity.IL2CPP.MethodWriter.WriteMethodBody(MethodReference method, IGeneratedMethodCodeWriter methodBodyWriter, IRuntimeMetadataAccess metadataAccess, ISourceAnnotationWriter sourceAnnotationWriter, IIcallMappingService icallMapping, VTableBuilder vtableBuilder, Action saveSequencePoints)
at Unity.IL2CPP.MethodWriter.<WriteMethodDefinition>c__AnonStorey0.<>m__0(IGeneratedMethodCodeWriter bodyWriter, IRuntimeMetadataAccess metadataAccess)
at Unity.IL2CPP.CodeWriterExtensions.WriteMethodWithMetadataInitialization(IGeneratedMethodCodeWriter writer, String methodSignature, String methodFullName, Action`2 writeMethodBody, String uniqueIdentifier, MethodReference methodRef)
at Unity.IL2CPP.MethodWriter.WriteMethodDefinition(IGeneratedMethodCodeWriter writer, MethodReference method, IMethodCollector methodCollector, IMethodVerifier methodVerifier, ISourceAnnotationWriter sourceAnnotationWriter, IIcallMappingService icallMapping, VTableBuilder vtableBuilder)
at Unity.IL2CPP.SourceWriter.<WriteMethodSourceFiles>c__AnonStorey3.<>m__0(IGeneratedMethodCodeWriter writer, TypeReference type)
at Unity.IL2CPP.SourceWriter.WriteEqualSizedChunks[T](NPath outputDir, IEnumerable`1 items, String fileName, Int64 chunkSize, Action`2 writeItemAction, SourceWritingContext sourceWritingContext)
at Unity.IL2CPP.SourceWriter.WriteMethodSourceFiles(NPath outputDirectory, SourceWritingContext sourceWritingContext, String fileName, IEnumerable`1 typeList, IMethodCollector methodCollector, Boolean writeMarshalingDefinitions)
at Unity.IL2CPP.SourceWriter.Write(NPath outputDir, SourceWritingContext sourceWritingContext, ReadOnlyCollection`1 assemblyDefinitions, IMethodCollector methodCollector, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.AssemblyConverter.Apply()
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName, NPath[] extraTypesFiles)
at il2cpp.Program.DoRun(String[] args)
at il2cpp.Program.Run(String[] args)
at il2cpp.Program.Main(String[] args)
stderr:
Unhandled Exception: System.Exception: Invalid method 'System.Boolean System.Type::op_Equality(System.Type,System.Type)' found in vtable for 'System.MonoType'
at Unity.IL2CPP.Metadata.VTableBuilder.ValidateAllMethodSlots(TypeDefinition typeDefinition, IEnumerable`1 slots)
at Unity.IL2CPP.Metadata.VTableBuilder.VTableForType(TypeDefinition typeDefinition, Dictionary`2 interfaceOffsets, Int32 currentSlot)
at Unity.IL2CPP.Metadata.VTableBuilder.VTableFor(TypeReference typeReference, TypeResolver resolver)
at Unity.IL2CPP.Metadata.VTableBuilder.IndexFor(MethodDefinition method)
Comment
This looks like a bug in IL2CPP. Can you submit a bug report for this issue?