-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Labels
Description
- Library version: 9.4.3
- Firebase Product: cloud messaging
When we are sending messages in bulk to devices using device specific tokens, we randomly get the error below:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:595)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:574)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:67)
at businessLayer.Messaging.sendPush(Messaging.java:777)
...
We are using the method sendEachAsync:
BatchResponse firebaseResponse = FirebaseMessaging.getInstance(firebaseApp).sendEachAsync(firebaseMessages, pushDryRun).get();
Besides the error showing up randomly when we are sending the messages, it seems that in older version of the library (<= 9.3.0), that the error is:
java.util.concurrent.ExecutionException: com.google.firebase.messaging.FirebaseMessagingException: com.google.firebase.messaging.FirebaseMessaging
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:594)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:573)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:67)
at businessLayer.Messaging.sendPush(Messaging.java:777)
...
The problem for us is that it seems that this error started showing up randomly last month.
At least some messages seem to be sent, because we have info that users are seeing and clicking on the notifications.
So, it seems that we are correctly calling the procedure.
Any help would be welcomed.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
google-oss-bot commentedon Feb 28, 2025
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
edonelezovic commentedon Mar 3, 2025
We have also started receiving a new error in the same method:
edonelezovic commentedon Apr 2, 2025
We made sure the Messages are not null and not empty.
Downgrading didn't prevent an error, but it was a different error, probably isn't handled in the newer version.
Older version:
java.util.concurrent.ExecutionException: com.google.firebase.messaging.FirebaseMessagingException: com.google.firebase.messaging.FirebaseMessaging
Newer version:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
We needed to implement our custom solution using the Firebase Cloud Messaging API, because we didn't know which push messages were being sent and which weren't when the above method returned an exception. We knew that some of the messages were being sent.