Foreground service - Pre Launch Report: Crash on Android 13 and 14

I created an update for an app (which uses a foreground service) in the Google Play Store and uploaded it there as an internal test track. The targetSdkVersion is 34 (Android 14). I get the following error message (crash) from the Google Pre-Launch Report for a Pixel 7 Pro (Android 14) and a test device with Android 13:

android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException

However, I cannot reproduce this crash on either my Pixel 7 Pro (Android 14) or my Pixel 4XL (Android 13). The app works perfectly, as expected.

Does anyone know the problem (with the Pre Launch Report)?


I use the current version of AI2 Media Notification.

Stacktrace:

android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException

Exception android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e4878b2 u0 appinventor.ai_bodymindpower.AT_klassisch/de.ullisroboterseite.ursai2medianotification.ForegroundService c:appinventor.ai_bodymindpower.AT_klassisch}
  at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException (ActivityThread.java:2243)
  at android.app.ActivityThread.throwRemoteServiceException (ActivityThread.java:2214)
  at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2520)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loopOnce (Looper.java:232)
  at android.os.Looper.loop (Looper.java:317)
  at android.app.ActivityThread.main (ActivityThread.java:8592)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:580)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:878)

The extension took too long to start the foreground service flag as required since Android 8.

1 Like

Hmm, I have been using the extension for years without any problems. I have already discussed the problem with Ulli. He said that the problem should not occur and in fact it does not occur on real devices. However, it does appear in the Pre-launch report environment for whatever reason. :upside_down_face: :woman_shrugging:

It also works fine on a

grafik

(Pre-launch report)


Only Pixel devices seem to be affected.

Then you should be all fine.


These kinds of scenarios happen when a part of code might fail unexpectedly but does not affect the main thread. Thus the extension never gets to start a foreground service (within x seconds as required by system)

These can also sometimes be unexpected and rare, considering how diverse Android ecosystem is. (Behavior wise)

It could be something that happens only under Google's test environment.

1 Like

Are all of the Pixel devices affected?

There are only two Pixel devices in the Pre-launch test environment (Android 13 and 14) and both are affected.

:pray:
Thank you!

The extension offers the properties ChannelID, ChannelName, ChannelDescription and ChannelImportance as channel properties.

A loop checking the existence of any of these properties and generating a timely temporal delay if it does not exist, so as to give time for the extension to be completely loaded or the service in the foreground is ready, would not solve the problem?

:pray:

Lito

@>-->---


Now Google is going completely crazy. :crazy_face: :upside_down_face:

1 Like

I had similar problems when being forced to reverify a verified web app. Gave up in the end.

I have ignored this message so far and my apps are (still) in the Play Store. Let's see how this madness continues, or in other words, when it ends...