title: Fatal Exception: java.lang.SecurityException: !@Too many alarms (500) registered inside Firebase
body: <p>I am getting following crash:</p>
  
  <pre class="lang-none prettyprint-override"><code>Fatal Exception: java.lang.SecurityException: !@Too many alarms (500) registered from pid 27251 uid 11383
         at android.os.Parcel.readException(Parcel.java:1620)
         at android.os.Parcel.readException(Parcel.java:1573)
         at android.app.IAlarmManager$Stub$Proxy.set(IAlarmManager.java:217)
         at android.app.AlarmManager.setImpl(AlarmManager.java:484)
         at android.app.AlarmManager.set(AlarmManager.java:260)
         at com.google.firebase.iid.FirebaseInstanceIdService.zzagl(Unknown Source)
         at com.google.firebase.iid.FirebaseInstanceIdService.zzd(Unknown Source)
         at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source)
         at com.google.firebase.iid.FirebaseInstanceIdService.zzm(Unknown Source)
         at com.google.firebase.iid.zzb$2.run(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
         at java.lang.Thread.run(Thread.java:818)
  </code></pre>
  
  <p>As you can see crash is inside Firebase library. I read other answers but all of them are about usage of Alarms inside the code, like <a href="https://stackoverflow.com/questions/29344971/java-lang-securityexception-too-many-alarms-500-registered-from-pid-10790-u">this</a> one. I am using just Firebase libraries for messages, analytics, and remote config.</p>
  
  <pre><code>compile "com.google.firebase:firebase-core:$firebaseLibVersion"
  compile "com.google.firebase:firebase-config:$firebaseLibVersion"
  compile "com.google.firebase:firebase-messaging:$firebaseLibVersion"
  
  ext {
      firebaseLibVersion = '9.6.1'
  }
  </code></pre>
  
  <p>Problems are happening only on Samsung devices, as expected. So, I know why it's happening on Samsung devices, but I don't know how to fix it.</p>