Skip to content

mpc use error: no ahead of time (AOT) code was generated #869

@kradshen

Description

@kradshen

Bug description

I have generated "MessagePackGenerated.cs" on MacOS.

dotnet-mpc -i "test/demo.csproj" -o "test/Assets/Scripts/MessagePack/MessagePackGenerated.cs" -m true

And I build an android app which is using IL2CPP by unity.

When I running it, the error occurs.

System.ExecutionEngineException: Attempting to call method 'System.Linq.Expressions.Interpreter.LightLambda::MakeRun3<System.Object,MessagePack.MessagePackSerializerOptions,System.Threading.CancellationToken,System.Byte[]>' for which no ahead of time (AOT) code was generated.
      at System.Func`2[T,TResult].Invoke (T arg) [0x00000] in <00000000000000000000000000000000>:0 
      at System.Linq.Expressions.Expression`1[TDelegate].Compile (System.Boolean preferInterpretation) [0x00000] in <00000000000000000000000000000000>:0 
      at MessagePack.MessagePackSerializer+CompiledMethods..ctor (System.Type type) [0x00000] in <00000000000000000000000000000000>:0 
      at MessagePack.MessagePackSerializer+<>c.<.cctor>b__43_0 (System.Type t) [0x00000] in <00000000000000000000000000000000>:0 
      at MessagePack.Internal.ThreadsafeTypeKeyHashTable`1[TValue].AddToBuckets (MessagePack.Internal.ThreadsafeTypeKeyHashTable`1+Entry[TValue][] buckets, System.Type newKey, MessagePack.Internal.ThreadsafeType

The code that makes this error is :

//rt is a Type. We get it from an Dictionary<string,Type>
MessagePackSerializer.Deserialize(rt, data)

How can I resolve it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions