Fixing issues with AOT compilation

MKinOZ 31 Reputation points
2024-03-28T04:42:41.8566667+00:00

Hello!

I have a .NET MAUI 8 app that I target for Android, WinUI and iOS.

I'm using EF Core (context is in separate project) and SQLite DB that gets created on app launch.

The issue is with the iOS version and I'm suspecting the issues is with AOT compilation.

All is working well when running it in a simulator or running on local iPhone or iPad.

However, when I "send" the app to Apple and then install it on a test device via TestFlight, the app crashes on startup.

I have followed a range of proposed solutions (https://github.com/dotnet/maui/issues/9176 and others) and added the below to the .csproj file for the main project:

`<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) Or $(TargetFramework.Contains('-ios'))">`

<UseInterpreter>true</UseInterpreter>

</PropertyGroup>

I also added <MtouchInterpreter>-all</MtouchInterpreter>, but it did not make a difference.

Anybody got suggestions on either how to solve this one or on how to narrow down the issue?

Thanks!

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,869 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grant Schaffer 0 Reputation points
    2024-04-20T21:09:12.8766667+00:00

    Hey Bruce,

    Thank you for your help.

    I changed all of the app’s views to compiled views and it still didn't work.

    The solution was to downgrade from Microsoft.EntityFrameworkCore.Sqlite V8.0.4 to V8.0.1

    After that, the iOS version of the app works again.

    Have a great day and thanks again,

    Grant

    0 comments No comments