paho.mqtt.android
paho.mqtt.android copied to clipboard
NULL Pointer Exception
This Exception is Occured when My Internet connection is Switched OFF and ON. Frequently happening
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Timer.cancel()' on a null object reference org.eclipse.paho.client.mqttv3.MqttAsyncClient.stopReconnectCycle (MqttAsyncClient.java:1120) org.eclipse.paho.client.mqttv3.MqttAsyncClient.reconnect (MqttAsyncClient.java:1057) org.eclipse.paho.android.service.MqttConnection.reconnect (MqttConnection.java:1049) org.eclipse.paho.android.service.MqttService.reconnect (MqttService.java:342) org.eclipse.paho.android.service.MqttService$NetworkConnectionIntentReceiver.onReceive (MqttService.java:827)
Are you on mqttv3:1.1.0? For me switching to paho.client.mqttv3:1.1.1 eliminated the problem.
Yes. Ill check with newer version. Gradle is not highlighting the version changes. That's why I did not know about this update.
I have the same problem, this is the stack trace:
Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in org.eclipse.paho.android.service.MqttService$NetworkConnectionIntentReceiver@1c954746 at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:924) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5660) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758) Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Timer.cancel()' on a null object reference at org.eclipse.paho.client.mqttv3.MqttAsyncClient.stopReconnectCycle(MqttAsyncClient.java:1120) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.reconnect(MqttAsyncClient.java:1057) at org.eclipse.paho.android.service.MqttConnection.reconnect(MqttConnection.java:1049) at org.eclipse.paho.android.service.MqttService.reconnect(MqttService.java:342) at org.eclipse.paho.android.service.MqttService$NetworkConnectionIntentReceiver.onReceive(MqttService.java:827) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:914) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5660) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)
@quadkastsiva "Are you on mqttv3:1.1.0? For me switching to paho.client.mqttv3:1.1.1 eliminated the problem." is it solve your problem?
am also get same problem so i changed version paho.client.mqttv3:1.1.1 ,but i got connect lost issues, My client MqttAndroidClient and am using (wss) can any one help me
This issue is occur in mqttv3:1.1.0. However, I can not reproduce this issue in mqttv3:1.1.1
I have the same problem with mqttv3:1.2.1...