Skip to content

AOT build warning: IL2026 triggered by JsonSerializer.Deserialize usage #195

Description

@IchiSamaFR

Actually working on a MAUI project for Android and iOS and i get this warning causing errors when calling the library.

The IL2026 warning indicates that using JsonSerializer.Deserialize may cause issues when building with AOT (Ahead-Of-Time) compilation.
This is because the dynamic code generation required for serialization and deserialization is not always compatible with AOT environments.
As a result, you may encounter runtime exceptions or incomplete data deserialization on platforms like iOS in Release mode.

Here is my error :

'GoogleMapsApi.Entities.PlaceAutocomplete.Response.Status[]' is missing native code or metadata.
This can happen for code that is not compatible with trimming or AOT.
Inspect and fix trimming and AOT related warnings that were generated when the app was published.
For more information see https://aka.ms/nativeaot-compatibility Path: $.status I LineNumber: 234 I BytePositionlnLine: 18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions