Вот мой код:
OkHttpClient().newCall(request).enqueue(object : Callback {
override fun onResponse(call: Call?, response: Response?) {
val body = response?.body()?.string()
val body1 = "{\"contents\":["+body+"]}"
println(body1)
val con = GsonBuilder().create().fromJson(body1, Con::class.java)
runOnUiThread {
recyclerView3.adapter= ChapterActivity.ChapterAdapter(con)
Я хочу получить JSON в классе Con:
class Con(val cont:List<contents>)
class contents(val content:String,val thumb:String)
ошибка:
FATAL EXCEPTION: OkHttp Dispatcher
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/*******/******/Con;