Search code examples
androiddelphiexceptiondelphi-xe8

Exception handling broken in Delphi XE8 Android


I have an application which has been working on Android for over a year.

Suddenly it has stopped working altogether.

It appears that the try..except..end mechanism has failed completely.

To verify, create a form with one TLabel and one TButton.

Add the code:

procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Text := 'What???';
  Try
    StrToInt('xxx');
  Except
    Label1.Text := 'Exception';
  End;
end;

I can run this and correctly debug it on my Sony phone but the exception does not get called and the application just closes.


Solution

  • Delphi XE8 does not officially support Android 6. I once developed app which runs correctly on Android 5, but had exception handling issues on Marshmallow. No problems with Delphi Seattle though. Glad to hear upgrading to Delphi 10 Berlin solved the problem!