Access Violation when starting a Service

I developed an android application where there is a service working in the background that job is to send notification about all rendezvous of the day. In the main Application onCreat even i created the service form :

Application.CreateForm(TTservice, Tservice);

and i created a Tswitchbutton to start the service and to stop it :

 if switchnotificationenable.IsChecked then
Fservice : TLocalServiceConnection;
      Fservice := TLocalServiceConnection.Create;

and another code in the service's event OnstartCommande :

Result := TJService.JavaClass.START_REDELIVER_INTENT;

when debugging a violation Access pointed at the code:


the error normally means that what i'm calling doesn't exist i was able to access a timer that is on my service form, so i have no idea what can be the problem.

i hope you guys can help me find the solution.

i'm using Delphi XE10.2 tokyo with an sqlite database,

have a good day everyone !


I found out that when i remove the file.jar of the service from the project the violation access error is gone but the service doesn't start.