Hi,
I'm on a project that uses MongoDB.
I have all the MongoDB [assemblies][1] and dependencies.
One of them is [ZstdSharp][2] wich causes an error from IL2CPP on WebGL build.
Here is the log:
C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe --convert-to-cpp --assembly=Library/Bee/artifacts/WebGL/ManagedStripped/Assembly-CSharp.dll
[...ASSEMBLIES...]
--assembly=Library/Bee/artifacts/WebGL/ManagedStripped/ZstdSharp.dll --data-folder=C:/Users/Fleurman/Scriipts/Library/Bee/artifacts/WebGL/il2cppOutput/data --generatedcppdir=C:/Users/Fleurman/Scriipts/Library/Bee/artifacts/WebGL/il2cppOutput/cpp --enable-analytics --emit-method-map --generics-option=None,EnableFullSharing --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=C:/Users/Fleurman/Scriipts/Library/Bee/artifacts/il2cpp_conv_st26.traceevents --print-command-line
Error: IL2CPP error for method 'System.Void ZstdSharp.Unsafe.Methods::.cctor()' in assembly 'C:\Users\Fleurman\Scriipts\Library\Bee\artifacts\WebGL\ManagedStripped\ZstdSharp.dll'
System.ArgumentOutOfRangeException: Cannot create a constant value for types of System.UIntPtr for System.UIntPtr ZstdSharp.Unsafe.Methods::ZSTD_blockHeaderSize (Parameter 'declaredParameterOrFieldType')
at Unity.IL2CPP.Metadata.MetadataUtils.GetBytesForConstantValue(Object constantValueToSerialize, TypeReference declaredParameterOrFieldType, String name)
at Unity.IL2CPP.Metadata.MetadataCollector.DefaultValueFromFields(PrimaryCollectionContext context, MetadataCollector metadataCollector, ITypeCollector typeCollector, IEnumerable`1 fields)+MoveNext()
at Unity.IL2CPP.Metadata.MetadataCollector.AddUnique[T](Dictionary`2 items, IEnumerable`1 itemsToAdd, Action`1 onAdd)
at Unity.IL2CPP.Metadata.MetadataCollector.AddFields(PrimaryCollectionContext context, IEnumerable`1 fields, MarshalType marshalType)
at Unity.IL2CPP.Metadata.MetadataCollector.<>c__DisplayClass43_0.b__0(TypeDefinition type)
at Unity.IL2CPP.Metadata.MetadataCollector.AddUnique[T,TIndex](Dictionary`2 items, IEnumerable`1 itemsToAdd, Func`2 onAdd)
at Unity.IL2CPP.Metadata.MetadataCollector.<>c__DisplayClass35_0.b__0(ModuleDefinition module)
at Unity.IL2CPP.Metadata.MetadataCollector.AddUnique[T](Dictionary`2 items, T item, Action`1 onAdd)
at Unity.IL2CPP.AssemblyConversion.PrimaryCollection.Steps.Global.CollectMetadata.ProcessItem(GlobalPrimaryCollectionContext context, ReadOnlyCollection`1 item)
at Unity.IL2CPP.AssemblyConversion.Steps.Base.ScheduledTwoInItemsStepFuncWithContinueFunc`5.WorkerWrapper(WorkItemData`3 workerData)
at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.ContinueWithResultsWorkItem`4.InvokeWorker(Object context, Int32 uniqueId)
at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.BaseContinueWorkItem`2.Invoke(Object context, Int32 uniqueId)
at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.WorkerLoop(Object data)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)
I'm using 2021.3.24f1 on Windows 10.
Everything works fine in the editor.
What can I do about it ?
Thank you.
[1]: https://www.nuget.org/profiles/MongoDB
[2]: https://github.com/oleg-st/ZstdSharp/tree/master
↧