Open changanfounder opened 3 years ago
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets
at org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.
I also encountered such a problem. How can I solve it? The problem occurred in Android 4.2 (API 17).
The problem has been solved. Because the StandardCharsets class is missing, we added it. Create a new package directory and copy the StandardCharsets class, and then run the verification successfully.
Please fill out the form below before submitting, thank you!
_Android API Version Bug Seen on: 17_
_Android Version Bug Seen on: 4.2_
Description of Bug:
MqttWireMessage.java Used StandardCharsets.UTF_8; but StandardCharsets.UTF_8 Added in API level 19(4.4)
Console Log output (if available):
W/dalvikvm( 1543): VFY: unable to resolve static field 2056 (UTF_8) in Ljava/nio/charset/StandardCharsets; D/dalvikvm( 1543): VFY: replacing opcode 0x62 at 0x0000 D/SERIAL_JNI_FM( 1543): SERIAL_read_Native ENTRY. I/SERIAL_HAL_FM( 1543): nRead = 0 D/SERIAL_JNI_FM( 1543): SERIAL_read_Native SUCCESS. W/dalvikvm( 1543): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lorg/eclipse/paho/client/mqttv3/internal/wire/MqttWireMessage; D/AndroidRuntime( 1543): Shutting down VM W/dalvikvm( 1543): threadid=1: thread exiting with uncaught exception (group=0x40fa29a8) E/SNPNS ( 1543): [PushSdkCrashExceptionHandler]>>>Push Service uncaughtException E/SNPNS ( 1543): java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets E/SNPNS ( 1543): at org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.(MqttWireMessage.java:52) E/SNPNS ( 1543): at org.eclipse.paho.client.mqttv3.internal.ClientState.(ClientState.java:162) E/SNPNS ( 1543): at org.eclipse.paho.client.mqttv3.internal.ClientComms.(ClientComms.java:108)