java.lang.ClassCastException: com.google.gson.JsonObject cannot be cast to java.io.File

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via GitHub by cbeust
, 1 year ago
com.google.gson.JsonObject cannot be cast to java.io.File
java.lang.ClassCastException: com.google.gson.JsonObject cannot be cast to java.io.File
at com.beust.kobalt.plugin.publish.RequestBodyConverter.convert(BintrayApi.kt:235)
at retrofit2.ParameterHandler$Body.apply(ParameterHandler.java:270)
at retrofit2.ServiceMethod.toRequest(ServiceMethod.java:108)
at retrofit2.OkHttpCall.createRawCall(OkHttpCall.java:178)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:162)
at com.beust.kobalt.plugin.publish.BintrayApi.validatePackage(BintrayApi.kt:105)
at com.beust.kobalt.plugin.publish.BintrayApi.uploadMaven(BintrayApi.kt:127)
at com.beust.kobalt.plugin.publish.PublishPlugin.uploadBintray(PublishPlugin.kt:80)
at com.beust.kobalt.plugin.publish.PublishPlugin.taskUploadBintray(PublishPlugin.kt:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.beust.kobalt.internal.TaskManager$toTaskAnnotation$1.invoke(TaskManager.kt:401)
at com.beust.kobalt.internal.TaskManager$toTaskAnnotation$1.invoke(TaskManager.kt:19)
at com.beust.kobalt.internal.TaskManager$addTask$1.call(TaskManager.kt:475)
at com.beust.kobalt.internal.TaskManager$addTask$1.call(TaskManager.kt:473)
at com.beust.kobalt.internal.TaskWorker$call$$inlined$forEach$lambda$1.invoke(TaskManager.kt:514)
at com.beust.kobalt.internal.TaskWorker$call$$inlined$forEach$lambda$1.invoke(TaskManager.kt:500)
at com.beust.kobalt.misc.BenchmarksKt.benchmarkMillis(Benchmarks.kt:5)
at com.beust.kobalt.internal.TaskWorker.call(TaskManager.kt:513)
at com.beust.kobalt.internal.TaskWorker.call(TaskManager.kt:500)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.