MAUI .NET 8 on Android -Unable to load DLL 'sqlite3'

Aneetha 65 Reputation points
2024-07-08T06:49:30.6566667+00:00

I have created a new MAUI .NET 8 project and migrated the Xamarin forms project code. When tried to run the project with the Android device in Visual Studio 2022 (windows), which threw the exception below,

System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found.

This happens when trying to open a database connection.

I am using the package below for the SQLite connection,

<PackageReference Include="Mono.Data.Sqlite" Version="1.0.61" />

Note: This exception happening only on Android, It's working properly in iOS.

Please help us to resolve this issue.

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

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 76,551 Reputation points Microsoft Vendor
    2024-07-09T05:06:30.89+00:00

    I find Mono.Data.Sqlite compatible target framework is not include the .NET 8, please try to use sqlite-net-pcl instead like this document: .NET MAUI local databases


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.