Android Question Android 14 : Starter Service Not Starting Even After 12.80 Update

chris ash

Member
Licensed User
Longtime User
Hi Guys

I'm in need of some help as im having an intermittant issue with my apps. After much research I have identified the issue to be as follows...

My app uses variables within the starter service of the app for storing Slot versions and stakes amongst other things. These variables are populated at various places thoughout the app but if we take the slot version variable for instance this is populated from Service_Create.

On Android 14
Start the app normally and the app is fine. Use the back soft key to exit the app all is fine. Reopen the app - No Issue

Start the app normally, use the III softkey (Whatever you call it) it then shows the app and offers the option to close it. Close it and all is fine. UNTIL you try to go back into the app.

Note: This is not everytime but seems to be sort of 1 in 3.

When going back into the app, the app will fail as the variables stored in the Starter service are no longer available. For example you close the app with slot version = 1. When you close by the above method and reopen the the app that same variable returns slot version = 0. Even though in the Service_create it should repopulate it, if it were to run.

See the below image this is an example of what happens in the logs on Android 14

1708122475509.png


As I mentioned this does not happen every time, when it works on Android 14 you will see the following in logs....

1708122677350.png


Note : There is mention of the starter service running the create process. Where as when it fails there is no mention of it at all.

Android 13 : No issue I can open and close the app as many times as I wish by this method no errors are received, The following image is what you can expect to see in the logs...

1708122829702.png


I am currently using version 12.8 of b4a. I updated to this latest version after reading posts on the forum stating people were having issues with the starter service, and after @Erel put out a new version to resolve some issues with the use of the Starter service on Android 14 devices.

Is anyone able to advise is there something obvious that I am missing, or that I am doing wrong? Or is there still an issue with b4a and the starter service on Android 14 devices?

Thanks in advance for yous assistance
CAsh
 
Last edited:

mcqueccu

Well-Known Member
Licensed User
Longtime User
It seems you are running the app in Release Obfuscated. The error from I see from the error is coming from image you declared in main. It could be your logic in loading image before the layout in which it is declared

Please run the app in debug and get the line which is causing the error or try and show some code or reproduce in small project. Thank you
 
Upvote 0

chris ash

Member
Licensed User
Longtime User
Please post logs as text.

Why is the app killed when you click on the back key? Are you calling ExitApplication?

Hi Erel my apologies I will put as text in future.

I have just checked and exit application is not used at all.

To reitterate if I use the back key I have no issue. The app pauses, and resumes as it should and the starter service loads as it should.

If I use the "RECENTS" soft key then close the app from there. Upon reopening the app every 1 in 3 times the starter service will not be created or starter. Thus variables that are populated in the Starter Create sub are not populated. And the code fails.

In the main activity create sub

If starter.Slotversion = 1 Then Do X
else If starter.Slotversion = 2 Then Do Y

The probelm is that the create sub has not ran, which populates Slotversion. So its a 0. Thus the Bitmaps do not load. Thus the error shown in log occurs.

Hope this helps
CAsh
 
Upvote 0
Top