Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

75
Visualizações
SCHEDULE_EXACT_ALARM warning despite not programming it

I see the following warning in PlayStore:

 Your use of exact alarms is causing your app to crash for some Android users
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.

Although, very specifically I only trigger an INACCURATE alarm as follows:

 val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
 val alarmIntent =
 Intent(context, MediaDownloadAlarmReceiver::class.java).let { intent ->
 PendingIntent.getBroadcast(
 context,
 0,
 intent,
 PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
 }

 val calendar =
 Calendar.getInstance().apply {
 timeInMillis = System.currentTimeMillis()
 set(Calendar.HOUR_OF_DAY, 5)
 set(Calendar.MINUTE, 0)
 }

 // Set the alarm to start at approximately 5:00 am
 alarmManager.setInexactRepeating(
 AlarmManager.RTC_WAKEUP,
 calendar.timeInMillis,
 AlarmManager.INTERVAL_DAY,
 alarmIntent)

Once the alarm goes off, I schedule a one-time worker request:

 override fun onReceive(context: Context?, intent: Intent?) {
 if (context != null) {
 MediaDownloadWorker.scheduleOneTimeRequest(
 context = context,
 source = "background_process")
 }
 }

Any idea what I'm missing?

over 2 years ago · Carlos Garzón Colorado
1 Respostas
Responde à pergunta

0

At first glance, setInexactRepeating() shouldn't require the SCHEDULE_EXACT_ALARM permission. If the Play Console is displaying that warning, it's possible that a dependency, third-party library, or even an older version of your app is internally using methods like setExact() , setExactAndAllowWhileIdle() , or setAlarmClock() .

It's also worth checking if WorkManager, Firebase, or another library related to background tasks is scheduling specific alarms on certain devices or Android versions. I would recommend searching your entire project for references to these methods and reviewing the crash report in Android Vitals to pinpoint the exact trace where the exception occurs. Without that trace, it's difficult to confirm that the displayed code is the source of the warning.

3 months ago · Ruben Alexander Serrano Porras Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda