Ole Mortensen
Ole Mortensen

Reputation: 105

Cannot load sqlite libraries in Android with Delphi 10.4

With Delphi 10.4 I get an error in my Android App (same error for both 32bit and 64bit).

[FireDAC][Phys][SQLite]-314. Cannot load vendor library [libsqlite.so or libdb_sql.so]. Hint: check it is in the PATH or application EXE directories, and has x86 bitness.

It has worked fine in previous versions of Delphi (latest 10.3.3).

Is it at bug, or has something changed with Delphi 10.4?


constructor TBrDataAccess.Create;
var
  AppDataName: string;
  DBExists: boolean;
begin
  try
    FFDGUIxProvider := 'Console';

    AppDataName := TPath.GetDocumentsPath + PathDelim + GetFileName;

    DBExists := FileExists(AppDataName);

    FConnection:=TFDConnection.Create(nil);
    FConnection.Params.Add('DriverID=SQLite');
    FConnection.Params.Add('Database=' + AppDataName);
    FConnection.Params.Add('OpenMode=CreateUTF8');
    FConnection.Params.Add('DateTimeFormat=String');
    FConnection.Params.Add('LockingMode=Normal');
    FConnection.Params.Add('Synchronous=Normal');
    FConnection.Params.Add('BusyTimeout=7500');
    FConnection.Params.Add('SharedCache=False');

    FConnection.FetchOptions.Mode := fmAll;  // Meget vigtig ved SqLite.

    FConnection.UpdateOptions.LockWait := True;
    FConnection.Connected := true;

    if not DBExists
    then if FConnection.ExecSQLScalar('pragma schema_version;') = 0
    then CreateDb;
  except
    on E : Exception
    do TBrMobileLog.AddLog(TBrLogFileType.LFTDb, 'TBrDataAccess', 'Create', E.Message, True);
  end;
end;

Upvotes: 4

Views: 2613

Answers (1)

alitrun
alitrun

Reputation: 1217

Try to include FireDAC.Phys.SQLiteWrapper.Stat unit into uses clause. Thank you so much da-soft. Now Sqlite works under Android x64.

Upvotes: 9

Related Questions