vedat 2 Posted November 25, 2021 Hello, I've tried to use fmx android service for my app. In the service I just use a simple notification that notify user as soon as the service started. When I start the service in my main app the program crashes when deploying to an android device. If I remove the line which I call the service in the main app it works properly in the android device. But once I try to call the service in the main app it just crashes. In the debug mode it gives Segmentation Fault (11) error but nothing. I know there is no problem with the notification process in the service because even when I remove the codes about notification from the service it stills crashes. (Btw I use Rad Studio 11) I would be grateful if get your help. Share this post Link to post
Guest Posted November 25, 2021 (edited) Hello, which Delphi version are you using? what is android device version, it can be tested more easily if you prepare and share a simple demo that shows the problem. Edited November 25, 2021 by Guest Share this post Link to post
vedat 2 Posted November 25, 2021 Thanks for reply. I'm using delphi 11, here is the link for demo : https://www.dropbox.com/s/qs1hoa92nx5hdsx/DemoTest.rar Share this post Link to post
Dave Nottage 557 Posted November 25, 2021 8 hours ago, vedat said: here is the link for demo : https://www.dropbox.com/s/qs1hoa92nx5hdsx/DemoTest.rar You have FMX.Types in the uses clause of Unit2 in your service. Not sure why, since it does not even need to be there. Regardless, that is why your service is failing. Please see this report: https://quality.embarcadero.com/browse/RSP-17857 1 Share this post Link to post
vedat 2 Posted November 26, 2021 Thank you for your answer Dave Nottage. Actually I didn't consider such a solution like that 🙂 When I tried to add timer component into the Unit2 which is service's unit it adds FMX.Types library automatically. Once it's been added you can't delete until you remove the timer component. I've missed to remove that FMX.Types while creating a demo. It comes from my original app, I copied all the uses section from it. Anyway, your beautiful attention solved the problem 🙂 If you do not mind can you give an advice about how to use something like timer in my service because I am doing some tasks related to time 1 Share this post Link to post
Guest Posted November 26, 2021 (edited) 23 minutes ago, vedat said: Thank you for your answer Dave Nottage. Actually I didn't consider such a solution like that 🙂 When I tried to add timer component into the Unit2 which is service's unit it adds FMX.Types library automatically. Once it's been added you can't delete until you remove the timer component. I've missed to remove that FMX.Types while creating a demo. It comes from my original app, I copied all the uses section from it. Anyway, your beautiful attention solved the problem 🙂 If you do not mind can you give an advice about how to use something like timer in my service because I am doing some tasks related to time I'm glad that the problem has been resolved. On the service side, we cannot use many fmx objects and units, so it is necessary to solve the problem with the native functions of the platform, many people don't know or ignore this situation, they think it's like development fmx gui app, and they're dealing with problems. for abount timer, you can check the here. https://github.com/grijjy/DelphiPlatformTimerQueue Edited November 26, 2021 by Guest Share this post Link to post
vedat 2 Posted November 26, 2021 1 minute ago, okoca said: I'm glad that the problem has been resolved. On the service side, we cannot use many fmx objects and units, so it is necessary to solve the problem with the native functions of the platform. You can check the timer here. https://github.com/grijjy/DelphiPlatformTimerQueue Thank you for your help okoca I got it Share this post Link to post
Guest Posted November 26, 2021 (edited) 12 hours ago, Dave Nottage said: You have FMX.Types in the uses clause of Unit2 in your service. Not sure why, since it does not even need to be there. Regardless, that is why your service is failing. Please see this report: https://quality.embarcadero.com/browse/RSP-17857 hey dave, thank you for your long support and contribution to the delphi community, take care. Edited November 26, 2021 by Guest Share this post Link to post