No Retrofit annotation found. (parameter #1)

前端 未结 14 1875
长发绾君心
长发绾君心 2020-12-09 00:50

I want get RSS code from a URL with Retrofit and if I enter url staticly in the get annotation everything is OK but with dynamic url I get an error.

My

14条回答
  •  执笔经年
    2020-12-09 01:15

    It's way too late, but i just faced the same issue. I was using retrofit 2.5.0 with 'deferred' and 'await' on my retrofit interface and viewModel. And I read from retrofit github that from 2.6.0 deferred is deprecated and we can switch from deferred to 'suspend'. before i moved my retrofit version up, i just simply changed from deferred to suspend and run it, and got the same error. I solved it by moving my retrofit version from 2.5.0 to 2.6.0.

    My point is that maybe there may be a chance that current retrofit version in your app doesn't support the way you use retrofit in your retrofit related classes or interfaces.

提交回复
热议问题