[RESOLVED] System.DllNotFoundException: 'e_sqlite3' .NET MAUI

Rowan Christie 31 Reputation points
2022-09-05T11:23:29.6+00:00

We are working on an App in .NET MAUI, which features an SQLite3 database.

The app & database works flawlessly when launching the app on Windows, and on an Android Emulator. However, if I launch the app to my Local Android Device (Physical device), the app immediately crashes returning the error "System.DllNotFoundException: 'e_sqlite3'".

No additional information is provided, and i'm not sure what other information would be relevant to provide in order to locate the issue. Anyone have any ideas?

Developer technologies .NET .NET MAUI
{count} votes

2 answers

Sort by: Most helpful
  1. Rowan Christie 31 Reputation points
    2022-09-06T07:49:14.127+00:00

    Thank you for taking the time to respond.

    I've just recently resolved the issue, and it turned out it was merely a deployment issue and performing a clean-build completely resolved the problem.

    Such a silly mistake caused way too much of a headache for me, it seems!

    4 people found this answer helpful.

  2. Bohdan Benetskyi 0 Reputation points MVP
    2023-11-29T11:37:26.67+00:00

    I still facing the same issue.

     Debug.WriteLine($"Directory Exist: {Directory.Exists(initialize.path_database)}"); //Directory Exist: True
                     Debug.WriteLine($"SQLite File Exist: {Directory.Exists(initialize.DB_source)}"); //SQLite File  Exist: False
    
    sqlite_pcl_connect_general = new SQLite.SQLiteConnection(initialize.DB_source, SQLiteOpenFlags.Create | SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.FullMutex); 
    
    
             <TargetFrameworks>net8.0-ios</TargetFrameworks>
    <PackageReference Include="sqlite-net-pcl" Version="1.8.116" />  
          <PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.6" />
    
    dotnet --info
    .NET SDK:
     Version:           8.0.100
     Commit:            57efcf1350
     Workload version:  8.0.100-manifests.71b9f198
    
    Runtime Environment:
     OS Name:     Mac OS X
     OS Version:  14.1
     OS Platform: Darwin
     RID:         osx-arm64
     Base Path:   /usr/local/share/dotnet/sdk/8.0.100/
    
    
    0 comments No comments

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.