gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

Android crashes on v4.0.1 #248

Closed aykutuludag closed 1 month ago

aykutuludag commented 1 month ago

Alarm plugin version v4.0.1

Describe the bug Some crash reports from Firebase Crashlytics

com.gdelataillade.alarm.alarm.AlarmService.onStartCommand java.lang.NullPointerException - Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

Fatal Exception: java.lang.RuntimeException: Unable to start service com.gdelataillade.alarm.alarm.AlarmService@386a492 with Intent { cmp=PACKAGE_NAME/com.gdelataillade.alarm.alarm.AlarmService (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4156)
       at android.app.ActivityThread.access$1900(ActivityThread.java:228)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1923)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7438)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:989)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
       at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:121)
       at org.json.JSONTokener.nextValue(JSONTokener.java:98)
       at org.json.JSONObject.<init>(JSONObject.java:164)
       at org.json.JSONObject.<init>(JSONObject.java:181)
       at com.gdelataillade.alarm.alarm.AlarmService.onStartCommand(:149)
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4138)
       at android.app.ActivityThread.access$1900(ActivityThread.java:228)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1923)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7438)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:989)
aykutuludag commented 1 month ago

JsonReader.unexpectedTokenError java.lang.IllegalStateException - Expected a string but was BEGIN_OBJECT at line 1 column 16 path $.stopButton

Fatal Exception: java.lang.RuntimeException: Unable to start service com.gdelataillade.alarm.alarm.AlarmService@3a4c3f4 with Intent { cmp=org.grandmount.dailyhoroscope/com.gdelataillade.alarm.alarm.AlarmService (has extras) }: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 69 path $.icon
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3472)
       at android.app.ActivityThread.-wrap21(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1651)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6351)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
Caused by com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 69 path $.icon
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(SourceFile)
       at com.google.gson.Gson.fromJson(Gson.java:4)
       at com.google.gson.Gson.fromJson(Gson.java:6)
       at com.google.gson.Gson.fromJson(Gson.java:9)
       at com.google.gson.Gson.fromJson(Gson.java:10)
       at com.gdelataillade.alarm.models.NotificationSettings$Companion.fromJson(NotificationSettings.java)
       at com.gdelataillade.alarm.alarm.AlarmService.onStartCommand(SourceFile)
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3455)
       at android.app.ActivityThread.-wrap21(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1651)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6351)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
Caused by java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 69 path $.icon
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
       at com.google.gson.stream.JsonReader.unexpectedTokenError(JsonReader.java)
       at com.google.gson.stream.JsonReader.nextString(JsonReader.java)
       at com.google.gson.internal.bind.TypeAdapters$15.read(TypeAdapters.java:2)
       at com.google.gson.internal.bind.TypeAdapters$15.read(TypeAdapters.java:1)
       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$2.readIntoField(SourceFile)
       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(SourceFile)
       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(SourceFile)
       at com.google.gson.Gson.fromJson(Gson.java:4)
       at com.google.gson.Gson.fromJson(Gson.java:6)
       at com.google.gson.Gson.fromJson(Gson.java:9)
       at com.google.gson.Gson.fromJson(Gson.java:10)
       at com.gdelataillade.alarm.models.NotificationSettings$Companion.fromJson(NotificationSettings.java)
       at com.gdelataillade.alarm.alarm.AlarmService.onStartCommand(SourceFile)
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3455)
       at android.app.ActivityThread.-wrap21(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1651)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6351)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
aykutuludag commented 1 month ago

BroadcastReceiver$PendingResult.sendFinished java.lang.IllegalStateException - Broadcast already finished

Fatal Exception: java.lang.IllegalStateException: Broadcast already finished
       at android.content.BroadcastReceiver$PendingResult.sendFinished(BroadcastReceiver.java:276)
       at android.content.BroadcastReceiver$PendingResult.finish(BroadcastReceiver.java:255)
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:4427)
       at android.app.ActivityThread.-$$Nest$mhandleReceiver()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:8046)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
aykutuludag commented 1 month ago

com.gdelataillade.alarm.alarm.BootReceiver.rescheduleAlarms java.lang.NullPointerException - Attempt to invoke virtual method 'java.lang.String com.gdelataillade.alarm.models.NotificationSettings.getTitle()' on a null object reference

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.gdelataillade.alarm.alarm.BootReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.gdelataillade.alarm.models.NotificationSettings.getTitle()' on a null object reference
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3707)
       at android.app.ActivityThread.access$2000(ActivityThread.java:229)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1903)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:7406)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.gdelataillade.alarm.models.NotificationSettings.getTitle()' on a null object reference
       at com.gdelataillade.alarm.alarm.BootReceiver.rescheduleAlarms(SourceFile)
       at com.gdelataillade.alarm.alarm.BootReceiver.onReceive(SourceFile)
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3700)
       at android.app.ActivityThread.access$2000(ActivityThread.java:229)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1903)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:7406)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)