Check your imports. Did you import TypeAdapter from the right place?
k
kenkyee
04/21/2020, 1:04 AM
java.lang.Class and com.google.gson.TypeAdapter
Right ones AFAIK.
b
Björn Mayer
04/21/2020, 7:32 AM
Are you using IntelliJ?
If so try to uncheck in the preferences:
Build, Execution, Deployment ➡️ Compiler ➡️Kotlin Compiler➡️
Enable new type inference algorithm for IDE analysis
If the error then shows up before compiling, you know that the new type inference would fix the problem.
There is a flag to enable it for compiling
k
kenkyee
04/21/2020, 10:07 AM
Interesting... This is in Android Studio unfortunately.
I'll see if I can load it in IJ..
a
Alexey Belkov [JB]
04/23/2020, 8:43 AM
In AS the setting is located in "File | Settings | Kotlin Compiler". In any case, please report an issue to http://kotl.in/issue with a self-contained code example. Thanks!