gdelataillade/alarm

3.1.3 Version - java.lang.RuntimeException

Closed this issue · 5 comments

Alarm plugin version
3.1.3

Describe the bug

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.handleServiceArgs (ActivityThread.java:5286)
  at android.app.ActivityThread.-$$Nest$mhandleServiceArgs
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2531)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.app.ActivityThread.main (ActivityThread.java:8893)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:608)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Caused by java.lang.NullPointerException:
  at com.gdelataillade.alarm.alarm.AlarmService.onStartCommand (AlarmService.kt:68)
  at android.app.ActivityThread.handleServiceArgs (ActivityThread.java:5268)

Device info
Provide device info (Manufacturer, OS version, ...)
[samsung t2s (Galaxy S21+ 5G)]

Additional context
The error was found in the Google Play Console.

Hi @synstin

How often does the issue happens ?
I'll try to fix this issue for the next release. I'll keep you updated.

@gdelataillade
This seems to happen quite often.
Thanks!

This also happens to me in version 3.1.4 when the set alarm is supposed to trigger, the above exception occurs.
Strange, because I had it working fine a week ago.

Samsung Galaxy S23 Ultra / Android 14

Thanks

Hey, I just managed to fix the issue in my case, so I figured out that in AlarmService.kt here https://github.com/gdelataillade/alarm/blob/main/android/src/main/kotlin/com/gdelataillade/alarm/alarm/AlarmService.kt#L63 that appIntent was null.
Reviewing my AndroidManifest.xml I found that I've combined two different intent filters into one by mistake, which can cause unexpected behavior when resolving intents. After splitting into two intent filters it started working again.

I'm closing this issue because in the meantime version 4.0.0 was released including a significant refactoring of the code and many bug fixes. Feel free to reopen if needed !