google / gson

A Java serialization/deserialization library to convert Java Objects into JSON and back
Apache License 2.0
23.34k stars 4.28k forks source link

Using gson to deserialize error reporting, the gson version I use is 2.10.1 #2597

Closed ligbyte closed 9 months ago

ligbyte commented 9 months ago

Gson version

2.10.1

Java / Android version

Android 13

Used tools

Gradle; version: classpath "com.android.tools.build:gradle:4.2.2"

eamonnmcmanus commented 9 months ago

ScanResult is not an interface, but it has fields like this one of type CharSequence which are the source of the problem. You probably want to write a TypeAdapter for ScanResult.

Marcono1234 commented 9 months ago

Specifically for CharSequence see this Stack Overflow answer for how to write a TypeAdapter for it.

ligbyte commented 9 months ago

Specifically for CharSequence see this Stack Overflow answer for how to write a TypeAdapter for it.

Thank you so much

ligbyte commented 9 months ago

ScanResult is not an interface, but it has fields like this one of type CharSequence which are the source of the problem. You probably want to write a TypeAdapter for ScanResult.

Thank you so much