TFDQuery causes the Failure of App to run on iOS Simulator (Delphi 10.3 Upd 3 Firemonkey)

  

I have issue with TFDQuery running on iOS platform having 2 TFDConnections with same SQLite drivers. The App is installed and tries to open but it closes right away without any error message. The error comes when the TFDQuery is set to active = true on either design time or runtime.
The reason why I am having 2 TFDConnections is one I need for RestAPI LocalSQL and the other is for my embedded database (SQLite3).
This issue I am not getting on Windows target platform. I am haven’t tried yet with Android.
Here’s my MRE for this case. Please note that I have not included the RestAPI LocalSQL in this example because the error is confined on the TFDConnections and TFDQuery only.
FMX Procedure:
unit main_u;

interface

uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf,
FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async,
FireDAC.Phys, FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef,
FireDAC.Stan.ExprFuncs, FireDAC.FMXUI.Wait, Data.DB, FireDAC.Comp.Client, System.IOUtils,
FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt,
FireDAC.Comp.UI, FireDAC.Comp.DataSet;

type
TForm9 = class(TForm)
con2: TFDConnection;
qry1: TFDQuery;
cur1: TFDGUIxWaitCursor;
dvr1: TFDPhysSQLiteDriverLink;
con1: TFDConnection;
procedure con2BeforeConnect(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form9: TForm9;

implementation

{$R *.fmx}

procedure TForm9.con2BeforeConnect(Sender: TObject);
begin
{$IF DEFINED(iOS) or DEFINED(ANDROID)}
con2.Params.Values[‘Database’] := TPath.Combine(TPath.GetDocumentsPath, ‘smartcart.s3db’);
{$ELSE}
con2.Params.Values[‘Database’] := ‘D:\My Project Files\5. my_projects_aws-rest\project_x_v0\application\client\database\smartcart.s3db’;
{$ENDIF}
end;

end.

FMX File:
object Form9: TForm9
Left = 0
Top = 0
Caption = ‘Form9’
ClientHeight = 480
ClientWidth = 289
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
object con2: TFDConnection
Params.Strings = (

‘Database=D:\My Project Files\5. my_projects_aws-rest\project_x_v’ +
‘0\application\client\database\smartcart.sdb3’
‘LockingMode=Normal’
‘DriverID=SQLite’)
Connected = True
LoginPrompt = False
BeforeConnect = con2BeforeConnect
Left = 128
Top = 168
end
object qry1: TFDQuery
Active = True
Connection = con2
SQL.Strings = (
‘SELECT * FROM lists’)
Left = 128
Top = 232
end
object cur1: TFDGUIxWaitCursor
Provider = ‘FMX’
Left = 80
Top = 32
end
object dvr1: TFDPhysSQLiteDriverLink
Left = 24
Top = 32
end
object con1: TFDConnection
Params.Strings = (
‘DriverID=SQLite’)
Connected = True
LoginPrompt = False
Left = 128
Top = 112
end
end

I’ve done some research and could not find any relevant solution to my case. I can say that the TFDQuery has some bugs or issues with regards to 2 TFDConnections with same drivers running at the same time on iOS platform.
Otherwise, I might have missed something here.

Comments are closed.