Resolving SQLite issues for .NET MAUI
Recently, while working on ExampleApp, we faced two significant errors and found effective solutions for both. Here’s a detailed account of the problems and their resolutions. System.TypeInitializationException To resolve this error, we needed to install the latest NuGet package for SQLitePCLRaw.bundle_green. This package ensures that the necessary SQLite libraries are included in the project. Add the following package reference with the latest version to your project: In the AppDelegate.cs file, add the following line to the CreateMauiApp method: System.ExecutionEngineException in iOS Release Mode This error occurs due to the JIT compilation attempt in AOT-only mode on iOS. The solution is to install this specific version of the sqlite-net-pcl.It will ONLY work with 1.7.355 or below. This solution is also applicable to Xamarin projects.
Hi, I am András,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.