-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashlytics error with useExactAlarm on version 14.1.1 #2033
Comments
I suspect there's a code issue with PR @kaptnkoala are you able to help with this? |
@mk-dev-1 if you know how this could be as fixed as well then do share. I thought the PR had fallbacks to help migrate existing scheduled notifications. Did your app use to schedule notifications with allow while idle set to true? |
@mk-dev-1 following from above question, do you by chance have a code snippet of the Dart code being invoked? The stack trace seems to suggest this isn't happening for notifications scheduled prior to 14.0.0 but for newer notifications scheduled after app updated to use 14.x |
All notification scheduling is happening exclusively via this snippet: return notificationManager!
.zonedSchedule(
id,
title,
subtitle,
tz.TZDateTime.from(date, tz.local),
NotificationDetails(
android: _getAndroidNotificationChannel(type),
iOS: DarwinNotificationDetails(
categoryIdentifier: await darwinNotificationCategoryId(type),
),
),
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime,
androidScheduleMode: AndroidScheduleMode.exactAllowWhileIdle, // <--- this has changed in the latest version
payload: payload,
matchDateTimeComponents:
recurring ? DateTimeComponents.dayOfWeekAndTime : null,
)
.then((result) => id!); Does that help in any way? In terms of helping to solve the issue, I'm afraid all I can do is test and observe. When it comes to Android programming, I'm of no help.... |
Afraid not. If anything, it's made it more confusing as the code snippet doesn't match the stack trace. Stack trace would indicate |
I can confirm with 100% certainty that this is the only place in the entire app that schedules any notification. As that snippet is used for creating weekly recurring notifications (see the matchDateTimeComponents part), could there be something in the background that would explain the stack trace? In any case, app is in beta channel for now and we will keep monitoring and provide updates here... |
Should clarify I wasn't doubting what code you call, was trying to explain that I can't make sense of how that aligns with the stack trace. I'm aware it's a weekly notification and tried to schedule one myself via the example app to check. I don't anything that would update the notification to add in a repeat interval that's specific to the |
Another to add, if you have confirmed you're using the plugin directly instead of a fork, are you able find a way to reproduce this issue e.g. reproduce this via the example app or link to a repo hosting a minimal app that can reproduce this? |
@MaikuB I have found the same issue on my app. The users who has the version of
Another crash
I have tried to reproduce but on local environment I am not able to reproduce but the crash are increasing. This was my old code
New code
|
What steps did you take to do this? I wanted to see if this included reproducing the scenario of a scheduling a notification using version 13 and then update the app where version 14.1.1 is used. Another thing is what are your Proguard rules? |
Device: Google Pixel 6 - Android 13
I am referring this file. Based on Crashlytics all the devices are in background while this crash |
Can you try seeing if you can reproduce the issue via the update scenario I mentioned earlier? I've tried to do this myself and can't reproduce the issue. Currently without a way to know how to reproduce this, I can't tell what the cause is and haven't been able to see how the code could cause this issue |
Sorry just looked at your response again @vishnunew where you actually said you tried this. So to double check, it means you attempted to reproduce the issue but wasn't able to successfully do this? |
@MaikuB Yes I have tried this but not able to reproduce it. I will try with different device again will let you know. |
@mk-dev-1 @vishnunew actually I have a hypothesis...for your applications, do you have records on what is the earliest version of the plugin that you used? If so, was there ever a point where you used the deprecated |
I believe I found a solution. Will try to get this out in 15.0.1 and try cherry pick the fix to a 14.1.2 release |
This is available now |
I am facing the same issue, @MaikuB I believe its resolved now. |
Thanks for sharing @gibbsvjy007 |
@MaikuB Apologies that I was not able to contribute any further on this issue. So extra big thank you for looking into it and resolving it so quickly. Really, highly appreciated! |
@mk-dev-1 no worries. Have you been able to confirm that it's resolved through rolling out an updated build yet? Seeing if I should leave this issue open a bit longer |
As @gibbsvjy007 has confirmed this has fixed the problem and have not heard more about this, I'm going to close the issue |
Should this error be resolved with
|
@nohli yours is related but different. Do you mean to say you have this issue on 15.1.0? If so, are you able to open a new issue and provide as much details on how to reproduce this? Ideally this would include a link to a repo hosting a minimal app |
@nohli I believe I've found a fix and is referenced in #2076. This is based on the 16.0.1 prerelease at the moment. Pretty confident about this fix but if you have time to test it out then be good to hear back about it. When I got time I'll continue to publish the PR etc and will push out "hotfixes" too |
I have updated to version 16.1.0, and am getting this same background crash. I am using zonedSchedule method. I have followed all the android setup guidelines in the readme section and have added the Proguard rules. I am in a fix, can't think of anything else to do. Please help. In the current version of my app with 16.1.0 version of this library, I have added USE_EXACT_ALARM permission as below. Have followed the android guidelines. [Previous version of my app was using 9.9.1 version of this library, and never faced any crashes.]
My zonedSchedule method looks like this
AndroidManifest.xml looks like this
This is the backround crash I am getting.
|
We just updated the flutter_local_notification dependency in our app to the latest version 14.1.1 and are slowly starting to see error messages come in as shown below. We have previously been using version 13.0.0, therefore suspect that this issue may have been introduct with version 14.0.0.
Note that our app does not declare
SCHEDULE_EXACT_ALARM
but usesUSE_EXACT_ALARM
since on-time notifications are absolutely paramount.Does anyone have any suggestions?
The text was updated successfully, but these errors were encountered: