top of page

Error: No Retrofit annotation found. (parameter #1)

  • Yazarın fotoğrafı: ANIL FIRAT
    ANIL FIRAT
  • 15 Nis 2020
  • 1 dakikada okunur

Today while I was adding my web service in Android I got an error which says "No Retrofit annotation found. (parameter #1)"


I searched online (as I did 1000 times in a day) and I found a helpful explanation in StackOverflow.



So why did I get this error? Because, I forgot to add @Header annotation.


@POST void try(@Header("Token") String token, @Body JsonObject body, Callback<Boolean> callback);


So, we need to make sure the "parameters" we pass to the "retrofit interface methods(i.e callbacks, headers, body )" are only belongs to "retrofit package". e.g.

Not custom callbacks that we want on we own.


C YA GUYS!

 
 
 

Commenti


©2019, Founded by CodeWithAnil

bottom of page