【问题标题】:Cannot load sqlite libraries in Android with Delphi 10.4无法使用 Delphi 10.4 在 Android 中加载 sqlite 库
【发布时间】:2020-09-17 00:53:38
【问题描述】:

使用 Delphi 10.4,我的 Android 应用出现错误(32 位和 64 位的错误相同)。

[FireDAC][物理][SQLite]-314。无法加载供应商库 [libsqlite.so 或 libdb_sql.so]。提示:检查它是否在 PATH 或应用程序 EXE 目录中,并且具有 x86 位。

它在以前版本的 Delphi(最新 10.3.3)中运行良好。

是出现 bug,还是 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;

【问题讨论】:

  • 尝试在uses子句中包含FireDAC.Phys.SQLiteWrapper.Stat单元。

标签: android sqlite firemonkey firedac delphi-10.4-sydney


【解决方案1】:

尝试将 FireDAC.Phys.SQLiteWrapper.Stat 单元包含在 uses 子句中。 非常感谢da-soft。 现在 Sqlite 可以在 Android x64 下运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-23
    • 1970-01-01
    • 2013-08-03
    • 2014-10-20
    • 2021-04-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多