Syncthing-Fork looking for help: Foreground service on Android 12+

Hi,

I’ve currently prepared a PR to raise API level to >= 31. But: My foreground service does not start. Logcat shows no errors, but I’m sure the service is the cause according to Android developer docs regarding the Service.START_STICKY and startForeground() functions. The symptom caused by this is the user can walk through the FirstStartActivity just fine and when MainActivity (plus the SyncthingService) launches, the screen flickers and Android log indicates a constant and fast occuring frequent restart of the App.

It’s like this: FirstStartActivity → MainActivity → SyncthingService (“crash” without log messages) → (from the beginning the same)

Any Android developer who knows how to adjust the code to comply with Android 12+ policies and can help is welcomed to assist me on this :-).

Kind regards, Catfriend1

PR which is ready to compile and run on Android 12+: Problem: Android 12+ doesn't allow to start the foreground service - Help appreciated by Catfriend1 · Pull Request #918 · Catfriend1/syncthing-android · GitHub

1 Like