Runtime error Xamarin.IOS · Issue #1296 · MessagePack-CSharp/MessagePack-CSharp · GitHub
Skip to content

Runtime error Xamarin.IOS #1296

Description

@aleGuardiola

Bug description

I am not sure if this a bug of the library itself or from the AOT compiler in Xamarin.IOS, I am trying to Serialize in Xamarin IOS I already precompiled the Serializers and the Formatters using mpc but I get:

Attempting to JIT compile method 'void Xamarin.Web.CommandServices.Formatters.Xamarin.Web.CommandService.CommandFormatter:Serialize (MessagePack.MessagePackWriter&,Xamarin.Web.CommandService.Command,MessagePack.MessagePackSerializerOptions)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

However when I add the Mono interpreter to the project I get a different error that I think it is related:
"Method not found MessagePackWriter.WriteRaw"

So what I think is MessagePackWriter.WriteRaw is not getting included in the final compilation for some reason. Any idea why this is happening?

Repro steps

PackSerializerOptions = MessagePackSerializerOptions.Standard.WithResolver(
            MessagePack.Resolvers.CompositeResolver.Create(
                Xamarin.Web.CommandServices.Resolvers.GeneratedResolver.Instance,
                Xamarin.Web.Plugins.Resolvers.GeneratedResolver.Instance,                
                StandardResolver.Instance
            ));
MessagePackSerializer.Serialize(command, PackSerializerOptions);

Expected behavior

Should Serialize the object

Actual behavior

What happened instead of what you expected.

  • Version used: latest
  • Runtime: Xamarin.IOS (AOT)

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions