As shown in the title, the problem comes back with the new Android Lifecycle 2.8.x.
All the solutions found on SO no longer work.
Reason: Context.startForegroundService() did not then call
Service.startForeground(): ServiceRecord{c7d45a4 u0 …}
The service is quite standard
class MService: Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
startForegroundService(intent)
val notification = MNotification(applicationContext).create(NotificationType.IOT)
startForegroundService(intent)?.let {
startForeground(NotificationType.IOT.id, notification)
}
return START_STICKY
}
}