无法使用 Delphi 10.4 在 Android 中加载 sqlite 库
Cannot load sqlite libraries in Android with Delphi 10.4
使用 Delphi 10.4 我的 Android 应用程序出现错误(32 位和 64 位的错误相同)。
[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.
它在 Delphi(最新的 10.3.3)的早期版本中运行良好。
它是否存在错误,或者 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;
尝试将 FireDAC.Phys.SQLiteWrapper.Stat 单元包含在 uses 子句中。
非常感谢da-soft。
现在 Sqlite 在 Android x64.
下工作
使用 Delphi 10.4 我的 Android 应用程序出现错误(32 位和 64 位的错误相同)。
[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.
它在 Delphi(最新的 10.3.3)的早期版本中运行良好。
它是否存在错误,或者 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;
尝试将 FireDAC.Phys.SQLiteWrapper.Stat 单元包含在 uses 子句中。 非常感谢da-soft。 现在 Sqlite 在 Android x64.
下工作