Bart Kindt 5 Posted November 29, 2023 In my Android app, in the Service, I have code which in Delphi 12 no longer works, and I don't understand why:  Type  TLocationListener = class; // <<<<[DCC Error] DTBU.pas(39): E2291 Missing implementation of interface method JLocationListener.onFlushComplete  // Then in TDTBThread: locationListener : TLocationListener;  // then further down: type  TLocationListener = class(TJavaLocal, JLocationListener)  public    constructor Create;    procedure onLocationChanged(location: JLocation); overload; cdecl;    procedure onLocationChanged(locations: JList); overload; cdecl;    procedure onProviderDisabled(provider: JString); cdecl;    procedure onProviderEnabled(provider: JString); cdecl;    procedure onStatusChanged(provider: JString; status: Integer; extras: JBundle); cdecl;  end;  The code is from years ago; Should I do it in a different way?  Share this post Link to post
Dave Nottage 619 Posted November 29, 2023 1 minute ago, Bart Kindt said: E2291 Missing implementation of interface method JLocationListener.onFlushComplete Your TLocationListener does not implement onFlushComplete, which was added to JLocationListener in Delphi 12: JLocationListener = interface(IJavaInstance) ['{D1CF3FB5-3BCB-4959-98D7-BD4D8F93D839}'] procedure onFlushComplete(requestCode: Integer); cdecl; procedure onLocationChanged(location: JLocation); cdecl; overload; procedure onLocationChanged(locations: JList); cdecl; overload; procedure onProviderDisabled(provider: JString); cdecl; procedure onProviderEnabled(provider: JString); cdecl; procedure onStatusChanged(provider: JString; status: Integer; extras: JBundle); cdecl;//Deprecated end;  Share this post Link to post
Bart Kindt 5 Posted November 29, 2023 That fixed it... I had no idea that it was _required_ that the 'missing' procedure had to be added in the final source code, as I am not going to use it... Â Big thanks Dave. Â Share this post Link to post
Rodrigo Silva 0 Posted June 13, 2024 (edited) Pode me informar como resolve este erro? Instalei a versão Delphi 12 e também tenho o mesmo problema.  [DCC Error] System.Android.SensorsDD.pas(137): E2291 Missing implementation of interface method JLocationListener.onFlushComplete [DCC Error] System.Android.SensorsDD.pas(137): E2291 Missing implementation of interface method JLocationListener.onLocationChanged  [DCC Fatal Error] UServico.pas(13): F2063 Could not compile used unit 'System.Android.SensorsDD.pas'   Pode me ajudar? Edited June 13, 2024 by Rodrigo Silva Share this post Link to post
Bart Kindt 5 Posted June 14, 2024 You must do what Dave Nottage said.  Share this post Link to post
Dave Nottage 619 Posted June 14, 2024 9 hours ago, Rodrigo Silva said: System.Android.SensorsDD.pas Assuming that the above unit is a modified copy of System.Android.Sensors.pas from an earlier version of Delphi, you'll need to update it to align with Delphi 12. Share this post Link to post