hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
824 stars 153 forks source link

Android MQTT: Crashing for devices with SDK 23 #608

Closed tessmerandre closed 6 months ago

tessmerandre commented 6 months ago

🐛 Bug Report

MQTT is not working for SDK level 23 since we updated Java to 17 on our Android app.

It throws a bunch of info logs to the logcat, and then it crashes on the .callback with the following exception: java.lang.NoClassDefFoundError: com.hivemq.client.internal.mqtt.c

Screenshot 2023-12-14 at 11 53 28

image

🔬 How To Reproduce

Steps to reproduce the behavior:

  1. Set the JAVA to 17
    compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
    }
  2. Run the app on Android SDK level 23

Code sample

All dependencies are set, including Retrofix:

classpath "com.github.sgtsilvio.gradle:android-retrofix:${Versions.retrofix}"

implementation Libs.mqtt
implementation Libs.retroStreams
implementation Libs.retroFuture
tessmerandre commented 6 months ago

Added core library desugaring to the app and seems to be fixed.