Open symphonybiz opened 2 years ago
The exception that gets thrown in this scenario is:
com.hivemq.client.mqtt.exceptions.ConnectionClosedException: java.lang.AbstractMethodError: abstract method "com.hivemq.client.mqtt.mqtt5.message.Mqtt5MessageType com.hivemq.client.internal.mqtt.message.MqttMessageWithUserProperties$WithReason$WithCode$WithId.getType()"
More specifically, it's not about debug vs release builds but rather about building with proguard vs without.
I think I'm facing a similar issue, because on production build around 2-3 gb of data seems to be used per day. I'm using mqtt3 instead of mqtt5 though. How do I check if I'm receiving messages in a loop in production builds? Logs don't work.
Expected behavior
MQTT works normally on release builds by following the android guide: https://hivemq.github.io/hivemq-mqtt-client/docs/installation/android/
Actual behavior
On debug builds the client works fine, but on release builds we noticed the same MQTT message keeps being "received" forever in an infinite loop. This is seems to be happening because of proguard obfuscation.
Solution
We managed to fix this by adding an additional line to proguard: