Questions tagged [retrofit2.6]
55 questions
1
vote
1 answer
OkHttp Dispatcher IllegalStateException when tried to make second network call
I faced this issue when I tried to migrate my network calls from "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter" to builtin retrofit 2.6 suspend function.
Scenario, I am making multiple sequential network calls to fetch data from…

Attiq ur Rehman
- 475
- 1
- 6
- 21
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
- 2,887
- 3
- 36
- 86
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…

Rakshith M R
- 11
- 2
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…

Edgar
- 860
- 1
- 17
- 38
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,559
- 6
- 27
- 57
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…

Usman sam
- 21
- 8
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
0
votes
1 answer
I am trying to connect android app with laravel using retrofit2. During login/register it throws error as:- java.lang.NullPointerException:
I have a problem with my android app, it crushes every time i run it. The error seems to be java.lang.NullPointerException. Here is the error.enter image description here
The error is java.lang.NullPointerException: Attempt to invoke virtual method…

said hamisi
- 1
- 1
0
votes
1 answer
How to handle multiple response with retrofit - Android
With retrofit I get response LevelsEntity but if I get error it get me ResponseError, NOTE: I cant merge LevelsEntity and ResponseError together in one entity.
LevelsEntity:
class LevelsEntity : ArrayList()
LevelsEntityItem:
data…

jo jo
- 1,758
- 3
- 20
- 34
0
votes
0 answers
retrofit header authorization not working
*i am tried to send token header using "Autorization" but response return empty. postman it's working. i used retrofit library. i tried two ways`
interface EtrApi {
@POST("getLoads")
fun getLoads(@Header("Authorization") accessToken: String
…

Krish
- 1
- 2
0
votes
0 answers
I am trying to decode my responsebody using APiResult sealed classess
My response is coming with status code 409 using the class method below under ApiResult.Failure.HttpFailure how can i get my response body. When i try to get the response it tells me the response is null.
ApiResult,Kotlin and Coroutines
This is the…

udeembno
- 29
- 1
- 6
0
votes
1 answer
Retrofit2 Silently Fails to Send to send Request
I am developing an android client to communicate with a REST server. I have been using Retrofit to do this. Up until this point it has been working fine, but today I implemented a new function to get a list of a users data from the server, and…

Birdfriender
- 343
- 1
- 7
- 24
0
votes
2 answers
How to convert content uri to file?
I want to send multiple images to my database using retrofit. I am using this code to select multiple images.
private val galleryLauncher =
registerForActivityResult(ActivityResultContracts.GetMultipleContents()) { list ->
…

Ankit Verma
- 496
- 5
- 21
0
votes
1 answer
In retrofit, can I get the endpoint uri with all dynamic values/query params before making the call?
Following is my RetrofitApi interface
const val USER_DETAIL = "private/{${Params.USER_NAME}}/details"
@GET(USER_DETAIL)
suspend fun getUsers(@Path(NetworkConstants.Params.USER_NAME) userName: String, @Query(NetworkConstants.Params.LANG) lang:…

Ahmad Shahwaiz
- 1,432
- 1
- 17
- 35
0
votes
1 answer
Retrofit response 500 null message
hello this is my code and why I cant get message like "The value is already exist" ?
why retrofit return null message in response with status 500?
call.enqueue(object : Callback {
override fun onResponse(call: Call,…

EagleCode
- 125
- 1
- 9