Skip to content

Pre-launch report: Your use of exact alarms is causing your app to crash for some Android users #112

@mustafa0x

Description

@mustafa0x

I submitted my app to the Play Store, and it was rejected due to crashing. The cause:

Your app schedules exact alarms without checking whether the SCHEDULE_EXACT_ALARM permission has been granted. This is causing your app to crash for users on Android 14 because the permission is no longer granted by default.

In most cases, alternative methods of scheduling work or inexact alarms are more appropriate. If your use of exact alarms is justified, update your app so that it checks this permission is granted before scheduling.

I checked the official docs. They say check canScheduleExactAlarms() first. However the code seems to indeed do so.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !alarmManager.canScheduleExactAlarms()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, request.scheduleAt.time, pendingIntent);

I have added <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
to AndroidManifest.xml, as specified in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions