hivemq/hivemq-mqtt-client

Android MQTT: Crashing for devices with SDK 23

tessmerandre opened this issue ยท 1 comments

๐Ÿ› 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
}
  1. 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

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