nproth / pin

A minimalistic note-taking app for android utilizing your phone's notification area.
GNU General Public License v3.0
116 stars 7 forks source link

Crashes on every device bootup v1.2.1 #5

Closed RockyJE closed 5 years ago

RockyJE commented 5 years ago

Crashes on every device bootup v1.2.1. Also with previous version.

DEVICE INFO: Huawei Mediapad M5 [8.4] Rooted w/xposed SHT-W09 (C567) LOS 15.1 [unofficial]

Stacktrace from Scoop app:

java.lang.RuntimeException: Unable to start receiver de.nproth.pin.receiver.BootReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=de.nproth.pin/.pinboard.PinboardService }: app is in background uid UidRecord{5ea8e6a u0a395 RCVR idle change:uncached procs:1 seq(0,0,0)} at android.app.ActivityThread.handleReceiver(ActivityThread.java:3194) at android.app.ActivityThread.-wrap17(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:108) Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=de.nproth.pin/.pinboard.PinboardService }: app is in background uid UidRecord{5ea8e6a u0a395 RCVR idle change:uncached procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1521) at android.app.ContextImpl.startService(ContextImpl.java:1477) at android.content.ContextWrapper.startService(ContextWrapper.java:650) at android.content.ContextWrapper.startService(ContextWrapper.java:650) at de.nproth.pin.receiver.BootReceiver.onReceive(BootReceiver.java:32) at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)

nproth commented 5 years ago

Thank you for the bug report. As a workaround you can disable battery optimizations for p!n in Settings, this should allow the app to start its background service. As you said version 1.2 is also affected but 1.1 should be fine. It is accessible via F-Droid but you might have to uninstall p!n first in order for the downgrade to succeed.

RockyJE commented 5 years ago

Fixed it—Thanks. Coulda sworn I'd checked that. ☺

nproth commented 5 years ago

An update that fixes the crash on boot is under way and should appear on F-Droid on over the next days. Disabling battery optimizations for p!n should then only be necessary on devices that hinder apps to start on boot (e.g. to save battery).