I'm trying to use retrofit's coroutine support in 2.5.1-SNAPSHOT but I keep getting a strange exception.
My retrofit service class has:
@GET("weather")
suspend fun getForecast(@Query("q") query: String, @Query("num_of_days") numDays: String = "1",
@Query("format") format : String = "json", @Query("key") apiKey: String = API_KEY)
: Weather
And when I try to call it I get:
2019-05-18 13:57:01.507 27422-27477/com.my.app E/MainPresenter$onResume$$inlined$CoroutineExceptionHandler: Something went wrong: No Retrofit annotation found. (parameter #5)
for method WeatherService.getForecast
Which seems odd, since the error is with parameter #5, but there are only 4 parameters. Anyone seen this before?
Also note, this is for a debug build with
minifyEnabled false
So I doubt it's proguard...
Turns out you need the SNAPSHOT version of the converter factory as well.
com.squareup.retrofit2:converter-moshi:2.5.1-SNAPSHOT
You need update retrofit, version > 2'6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With