i got some emails from users complaining that my apps won't start on there phones. after some checks i can confirm that my app does not ALWAYS launch the same on Android 14.
in the logs i can see that the Starter Service is started but app not.
the problem is that it is not always happening. after install the first start always works fine but then closing the app completely (no just sending to background) and then start again i only see a white screen.
if you want to reproduce the issue just run an Android 14 Emulator or physical device and install the app in release mode. Then perform a complete close and start again. repeat this process several times and you should get into a white screen.
Logs will show that the starter service has started but the app not.
i also noticed that when i close the app and remove it from the stack the starter service is created. when i again open the app the starter service is started and not created and in this scenario the app won't start.
to start the app the service need to be created then it will start the app.
see video:
Hello there, first of all, did any of you had a TON of problems with samsung devices since their october security update? Because on all our app i've seen a dramatic rise in crash logs and all from flagship samsung devices. Most of them are nullpointer exception in sub calls, which makes me...
Hello there, first of all, did any of you had a TON of problems with samsung devices since their october security update? Because on all our app i've seen a dramatic rise in crash logs and all from flagship samsung devices. Most of them are nullpointer exception in sub calls, which makes me...
actually it will do it with the default b4a app.
open b4a and create a new project (default)
install android 14 on the emulator and run the app in release mode.
then close app -> open -> close -> open and you will see it that it will start without loading layout. and in logs the service starter is started but not created, it is created when you remove the app from the app stack as shown in the video.
it is effecting any app that will run on android 14 even without using any special libraries.
Have you tried stopping the Starter service?
I have long been in the habit of stopping the service in every application so that there is no problem when restarting.
I know that this is not recommended, but I get along very well with it.
B4X:
Sub Activity_Pause (UserClosed As Boolean)
' Log("Activity_Pause UserClosed=" & UserClosed)
If UserClosed Then
'Service beenden
CallSub(Starter, "Service_Stop")
ExitApplication
End If
End Sub
Have you tried stopping the Starter service?
I have long been in the habit of stopping the service in every application so that there is no problem when restarting.
I know that this is not recommended, but I get along very well with it.
B4X:
Sub Activity_Pause (UserClosed As Boolean)
' Log("Activity_Pause UserClosed=" & UserClosed)
If UserClosed Then
'Service beenden
CallSub(Starter, "Service_Stop")
ExitApplication
End If
End Sub
But if you return to the app you will need to load everything again.
This is not the way i would like to solve the issue. The app should be able to go to background and allow a quick return but when the app is removed from the background tasks it should work when you open it again. And on android 14 there seems to be an issue with the starter service but i am not sure
thanks for your feedback erel,
since it is an old project i am using the starter service to load many stuff and store them there.
it is not a b4xpages app it is a b4a only app.
removing the starter service will cause other issues i guess like getting variables from activity to another. with the starter service all public variables are stored there and it is safer to use them
should i change the starter service with a receiver ?
what do you recommend to do?
as i said it will started again and load everything again and that takes time.
if you use ExitApplication the app goes also from background and you will need to make a full app start but if you use activity.finish or just go to main screen on your android device the app and all UI is still available and the return to the app is much much quicker.
ok, i did it with the default b4a app and when the ide first time install the app on the emulator running android 14 i get the whole app start cycle when i close the app -> remove from background i get the Service (starter) Start but not create. it is created on the second you remove it from the background task.
stopping the service on activity pause seems to solve the issue.
is it ok to call this code erel?
B4X:
Sub Activity_Pause (UserClosed As Boolean)
If Not(UserClosed) Then StopService(Starter)
End Sub
EDIT: it fixes the behavior and it is also a very simple fix, the question is, is it safe? i made some test and the variables are still available even if i close the app using back key or home button and then return to the app