alibaba / fastjson2

🚄 FASTJSON2 is a Java JSON library with excellent performance.
Apache License 2.0
3.78k stars 495 forks source link

[BUG]Failed resolution of: Ljava/time/LocalTime; #645

Closed ncnnnnn closed 2 years ago

ncnnnnn commented 2 years ago

implementation 'com.alibaba:fastjson:2.0.11.android'

android 7.1 不支持 ObjectWriterProvider的 java.time.LocalTime.class,

JSON.toJSONString(hashMapOf<String, String>(Pair("1", "a")))

java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/LocalTime; at com.alibaba.fastjson2.writer.ObjectWriterProvider.(ObjectWriterProvider.java:185) at com.alibaba.fastjson2.JSONFactory.(JSONFactory.java:242) at com.alibaba.fastjson2.JSONFactory.getDefaultObjectReaderProvider(JSONFactory.java:303) at com.alibaba.fastjson.JSON.(JSON.java:50) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:756)

wenshao commented 2 years ago

需要Android 8+,不支持Android 7.1