Backendless Support

Error when sending messages from one device to another,


When sending messages from one device to another, when the sender is Android 4.4 or lower I get the error message:

"java.lang.ClassCastException: java.util.HashMap cannot be cast to com.backendless.messaging.MessageStatus


at com.backendless.async.message.AsyncMessage$ResponseHandler.handle(

at com.backendless.async.message.AsyncMessage.handleCallback(

at com.backendless.core.AndroidCarrier$1.handleMessage(

at android.os.Handler.dispatchMessage(

at android.os.Looper.loop(


at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(



at dalvik.system.NativeStart.main(Native Method)"

This does not happen with devices of Android versions higher than 4.4 since both the sendings and receptions work perfectly.From a device with Android 4.4 or lower the messages are correctly received and also sent correctly since the receiver receives them but the error appears and the application stops working.I have looked at all the topics that already exist in your database and I have tried with the example projects that you indicate but I continue having the problem and I do not know what else to try !!

My sending statement:

List<String> devices = new ArrayList<>();

devices.add(deviceToSend);DeliveryOptions deliveryOptions = new DeliveryOptions();deliveryOptions.setPushSinglecast(devices);

PublishOptions publishOptions = new PublishOptions();

publishOptions.putHeader( "usuarioEmisor", global.nombreUsuario );

publishOptions.putHeader( "usuarioReceptor", global.nombreUsuarioDestino );

Backendless.Messaging.publish((Object) global.mensajeParaEnviar, publishOptions, deliveryOptions, new AsyncCallback<MessageStatus>() {

public void handleResponse(MessageStatus response) {

System.out.println("Mensaje ok : ");


public void handleFault(BackendlessFault backendlessFault) {

System.out.println("Mensaje ko : " + backendlessFault.getDetail());



By the way, I´m using the backendless-4.4.0-javadoc library.


Leave a Comment

Comments (1)


Hi, Joan.

We support our android library for os level higher than API-21 (Android 5.0 Lollipop).

Google itself doesn't support such old os (i mean bug and security patches).