Closed Canato closed 1 year ago
Hi @Canato
It seems that you are missing the proguard-android-optimize.txt
in your proguardFiles
configuration.
android {
buildTypes {
release {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
}
The file proguard-android-optimize.txt
configures necessary rules for enum classes as you can see here: https://android.googlesource.com/platform/sdk/+/master/files/proguard-android-optimize.txt#48
Please comment if this helps.
Indeed we don't use this file on the project, never had the need before! Thanks @SgtSilvio
Expected behavior
Using the provide proguard settings the client should build without issues
Actual behavior
Using the provide rules:
or
We get the exception
ExceptionInInitializerError
this is related tocom.hivemq.client.mqtt.MqttClientState.<clinit> (MqttClientState.java:74
where we have the exceptionNoSuchMethodException
because the values insideAtomicReference
class used onMqttClientConfig
are empty. a.k.avalues[]
Logs:
As can be seen we do call
state = new AtomicReference<>(MqttClientState.DISCONNECTED);
line 95 onMqttClientConfig
but on line 74 atMqttClientState
when we call the value:It crashes.
To Reproduce
Not sure
Adding the pro guard rules
solve the issue.
Should update the documentation? didn't find it in this repo, can open a PR if helps.
Details
1.3.0
Java 11
Android 11
(happen in many other too)3
session broker v3