java.lang.IllegalArgumentException: Service methods cannot return void. for method MyApiRequestInterface.getJson

Hot problem!
This exception has a lot of traffic. You can help 13 users by writing a short tip.

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

Solutions on the web

via Stack Overflow by Fidelis
, 1 year ago
Service methods cannot return void. for method MyApiRequestInterface.getJson
via GitHub by ericn37
, 1 year ago
Method return type must not include a type variable or wildcard: retrofit2.Call<com.github.jasminb.jsonapi.JSONAPIDocument<java.util.ArrayList<? extends com.xxx.yyy.models.BaseModel>>> for method SearchService.retrieveSearch
via Stack Overflow by user3015410
, 1 year ago
Service methods cannot return void. 12-31 06:59:32.405: E/AndroidRuntime(31013): for method UnicsAgencyApi.getStreams
via GitHub by JakeWharton
, 1 week ago
Non-body HTTP method cannot contain @Body. for method AuthenticationApi.authV1PinDeleteDelete
via GitHub by JakeWharton
, 1 week ago
Non-body HTTP method cannot contain @Body. for method AuthenticationApi.authV1PinDeleteDelete
via GitHub by nealsanche
, 1 week ago
Non-body HTTP method cannot contain @Body. >> for method AuthenticationApi.authV1PinDeleteDelete
java.lang.IllegalArgumentException: Service methods cannot return void. for method MyApiRequestInterface.getJson
at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:720)
at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:711)
at retrofit2.ServiceMethod$Builder.createCallAdapter(ServiceMethod.java:228)
at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:160)
at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:166)
at retrofit2.Retrofit$1.invoke(Retrofit.java:145)
at java.lang.reflect.Proxy.invoke(Proxy.java:397)
at undefined.$Proxy1.getJson(Unknown Source)
at it.uniba.di.ivu.sms16.gruppo26.it.andriasmart.Fragment.BusFragment.using_retrofit(BusFragment.java:369)
at it.uniba.di.ivu.sms16.gruppo26.it.andriasmart.Fragment.BusFragment$7$1$2.onMarkerClick(BusFragment.java:323)
at com.google.android.gms.maps.GoogleMap$15.zzd(Unknown Source)
at com.google.android.gms.maps.internal.zzp$zza.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:395)

Users with the same issue

3 times, 7 months ago
2 times, 10 months ago
2 times, 1 year ago
3 times, 1 year ago
6 times, 1 year ago

Write tip

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