Questions tagged [retrofit2.6]

49 questions
10
votes
1 answer

Retrofit 2.6.0: Custom Coroutines CallAdapterFactory

I need to do custom error handling in my api and I wanted to use coroutines with the new version of Retrofit. Since we don't have to use Deferred any longer, our own Jake Wharton wrote this on reddit a month…
Leonardo Deleon
  • 2,157
  • 3
  • 12
  • 21
5
votes
2 answers

Retrofit 2 on sdk < 21

I used Retrofit library in my android application. My project's minSDK is 16. Now I see that my apps not working on SDK < 21 because of retrofit version. My retrofit version: implementation 'com.squareup.retrofit2:retrofit:2.6.1' implementation…
Behrooz Fard
  • 448
  • 3
  • 21
4
votes
2 answers

Two questions about providing instance of HttpLoggingInterceptor for OkHttpClient in Dagger 2 module

I am developing an Android project with Kotlin and Dagger 2. I have a NetworkModule it is supposed to provide a singleton instance of Retrofit. in which I define all those provider functions. All code snippet below are inside NetworkModule…
user842225
  • 4,171
  • 6
  • 42
  • 74
2
votes
1 answer

WorkManager job doesn't get rescheduled or it doesn't fire after some time

I´ve been facing a issue with WorkManager when reescheduling jobs. Currently, I´ve found that at some point after launching a request with Okhttp and raising an error on AuthInterceptor it gets stuck and no other job gets launched. This is the…
axierjhtjz
  • 6,647
  • 6
  • 47
  • 65
2
votes
0 answers

Retrofit 2 - Field is not working with @FormUrlEncoded when targeted sdk is Android Pie but @Body is working fine

I am trying to make the Api call using Retrofit 2 POST method with @Field and @FormurlEncoded in Android but it just doesn't work in Android PIE. I have integrated Apis using retrofit thousands of time before. But this time I have targeted sdk…
Sagar Shah
  • 4,002
  • 1
  • 22
  • 35
2
votes
1 answer

Need help Kotlin Coroutines, Architecture Component and Retrofit

I'm trying to wrap my head around the mentioned components and I can't get it right. I want to do something very simple: Fetch data from the network and present it to the user. Currently am not yet caching it as am still learning new Coroutine…
1
vote
0 answers

How to get upload progress percentage in retrofit mulitpart request?

Following is the multipart request that i am performing using retrofit2. What i want is to somehow get a callback of the upload percentage. But i cannot a find a suitable method for doing this. I have saw few methods but they are only playing with…
Malik Bilal
  • 182
  • 4
  • 12
1
vote
1 answer

Retrofit response.errorBody cannot be converted to JsonObject or Java Obejct

When the API is called it return an object in onScuccess with status code 201 and when not in onSuccess along with status code 422 it also gives an object like this { "errors": [ "Usuário não encontrado" ] } I have tried many ways…
1
vote
2 answers

Retrofit 2.6.2 is not working on Vodafone mobile data but works fine on WiFi

Please help me Some of my app users are complaining or giving feedback that their app doesn't work on mobile data (Vodafone 4G) but works on wifi. I am using Retrofit-2.6.2 and okhttp3 - 4.2.2. Retrofit.Builder() .baseUrl(baseurl) …
DeePanShu
  • 378
  • 3
  • 9
1
vote
1 answer

Data is not showing in recycler view from an api

I am trying to fetch data from server and showing it in recycler view.I am using retrofit library and RxJava2 but its unable to fetch data from server. Its showing following line in LogCat: E/RecyclerView: No adapter attached; skipping…
Digvijay
  • 1,692
  • 1
  • 14
  • 40
1
vote
2 answers

Problem with working with Multipart form data Retrofit2

I know it is not wise to use multipart for simple text authentication. but I need to use it with api provided to me. I tried all the methods possible. It's working fine with postman but not with retrofit 2 request type details request type…
1
vote
0 answers

how to use suspend properly over deferred in kotlin coroutines?

I am developing news app and I have implemented kotlin coroutines since Retrofit 2.6.0 has been released with support for suspend functions. I have implemented suspend function over deferred function and followed this tutorial but I am getting empty…
sashabeliy
  • 355
  • 1
  • 8
  • 20
1
vote
0 answers

Retrofit api form url encoded not working when i have ó in address it becomes ón Android same api if i hit with postman than it works?

Since long time i am working on this issue but i didn't get success. I am still trying to solve this issue. I used Retrofit Api 2.6.2 version in my application. If i am hit api with Postman it works successfully. 1. I am getting address from google…
Mahesh
  • 1,401
  • 5
  • 25
  • 52
1
vote
1 answer

Kotlin Coroutines, retrofit-2.6.1, Network response null

I am going through reso-coder Weather app tutorial. Most of the things changed with the passage of time, so is apixu weather website. Now it's the time of Retrofit 2.6.1 which means kotlin coroutines The problem is that i am getting everything…
1
vote
0 answers

Kotlin generic post request

Hio, i´m working on a generic interface for Retrofit API calls in Kotlin. I´m kinda new to Kotlin and i feel like i´m missing something important. i tried to search for a solution but didnt found one. This is my…
Fragening
  • 11
  • 1
1
2 3 4