ostrya / PresencePublisher

An Android MQTT client that regularly publishes messages to notify about the device's presence
MIT License
79 stars 12 forks source link

App crashes after publishing on Android 10 #56

Closed qorron closed 2 years ago

qorron commented 2 years ago

Hi,

first: works fine on Android 12

I installed it on another phone (oneplus 5, stuck at android 10) and the aspp crashes randomly and immediately after it has sent out the mqtt messages. Interesting: it survives the "test connection" message. when I press "run now" in schedule it publishes all messages it was supposed to send and then dies every time I do this.

It offers to share a stack trace, so here it is:

Thread[main,5,main] crashed due to android.app.RemoteServiceException: Bad notification for startForeground
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2039)
 at android.os.Handler.dispatchMessage(Handler.java:107)
 at android.os.Looper.loop(Looper.java:214)
 at android.app.ActivityThread.main(ActivityThread.java:7697)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

config details: TLS is on with a valid cert from letsencrypt, auth via username and pwd message format is plaintext with two messages being sent. send absence message and send without wifi are on all permissions are granted, battery autokiller (aka optimisation) is off for this app. everything else is pretty much default