Questions tagged [retrofit2]

Retrofit2 is the second version of the type-safe REST client Retrofit for Android and Java. It is developed by Square, Inc.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
18 views

Retrofit2 - Upload image to server give an 500 Internal Server Error as response in android studio

I am trying to send image files from my android app to a back end server. On Postman, images are sent and response code:200 is received. enter image description here However, trying to send images ...
depressed's user avatar
0 votes
0 answers
49 views

How to observe livedata in Compose within coroutines

I am practicing compose along with layout based app since it is interoperable I am facing issue in observing the livedata of my view model inside the compose screen using rememberCoroutineScope. ...
Sumit Vishwakarma's user avatar
0 votes
1 answer
44 views

Retrofit Exception

I have integrated the Retrofit library for server calls. I get the below exception when I get a response in retrofit and the app crashes. Unable to understand what's going wrong. FATAL EXCEPTION: ...
Kalpana Aneyrao's user avatar
0 votes
0 answers
21 views

Android App Crashing Issue for FORTIFY: FD_SET: file descriptor 3682 >= FD_SETSIZE 1024

I am developing an android app using kotlin/jetpack compose and after running the app it crashed about 20 minutes later. The logcat shows the following error. But I can't understand what's the reason. ...
Al amin Kawsar's user avatar
0 votes
0 answers
4 views

Could not locate call adapter for class java.lang.Object

I'm getting this exception in my project with kotlin & suspend & coroutine #19089618 java.lang.IllegalArgumentException Could not locate call adapter for class java.lang.Object. Tried: * ...
el magnifico's user avatar
0 votes
0 answers
28 views

Gson custom alternate key/data type deserializer not working?

I have two fields in my json object that could be of two different data types and two different keys I need to be able to convert. I created a custom deserializer to handle the alternative key and ...
MyAcct's user avatar
  • 1
1 vote
0 answers
22 views

Batch Processing in Android using Retrofit

I am trying to achieve batch processing in android in java using retrofit. I have a batch payload with me, when i use it in postman it gives me a response of 201 with the correct body, but when i try ...
Mohnish Kamble's user avatar
0 votes
0 answers
19 views

Error 403 Forbidden when hit the API using retrofit in android

I am trying to hit the API in android using retrofit to get the token from File Browser. It works if I run the command from command prompt like this : curl -X POST -d "{"username": &...
zeifi's user avatar
  • 33
0 votes
0 answers
42 views

Is it possible to send DTO list using Retrofit2 in Android?

I'm a student studying Android programming using Kotlin. I'm currently working on a small project. I need to send a DTO list so that the server side can use it as follows. dataList[0].text // data ...
blonded's user avatar
  • 21
1 vote
0 answers
22 views

Serializing json in retrofit 2 errors

I am following some kotlin path on Google and for the bookshelf app I want to parse and serialize the response to this GET request: https://www.googleapis.com/books/v1/volumes?q=jazz+history I am ...
Catosh's user avatar
  • 193
0 votes
0 answers
30 views

Handling Refresh Token Synchronization for Concurrent API Calls in Android Kotlin(Retrofit,AsyncHttpClient)

I am working with an Android app that uses both Retrofit and AsyncHttpClient libraries. I encounter a situation where I need to handle token expiration scenarios even when a 200 OK response is ...
Bingotop's user avatar
0 votes
0 answers
35 views

How to set POST Request to GitHub REST API?

I need to write android app , with GitHub REST api ! So in first user need to authorize in the app , For first , i need to set POST request , and get some information abouth user ! please help me... ...
Karen Vardanyan's user avatar
0 votes
0 answers
49 views

Retrofit response is null but okHttp Interceptor logger has data

I have a POST request to get data based on a SessionKey that's generated. If the SessionKey is valid, then there is a response of some Customer data. The issue I'm facing is that my Retrofit instance ...
Dean Ball's user avatar
0 votes
0 answers
10 views

Key and value must be in retrofit Header

I made an application using Retrofit, but there is a problem without the token does not work. Must use Key and Value (Token). I understand that it is necessary to do it with the help of Header, but ...
3DShnik's user avatar
0 votes
1 answer
36 views

My API call isn't working and my app return me "Expected BEGIN_ARRAY but was BEGIN_OBJECT at path $ solution"

Hi I'm currently working on a android app (android studio) for a class and i need to make API calls i followed some tutorials (android developper and some on YT). From these tutorial i learned to use ...
Zares's user avatar
  • 1
0 votes
0 answers
29 views

Unable to Retrieve Movie Posters Using TMDB API in Android Studio

I am currently developing an Android app using Android Studio, and I'm facing an issue with retrieving movie posters from the TMDB API. I have successfully fetched movie titles, but I am struggling to ...
Parikshit verma Honey's user avatar
0 votes
1 answer
47 views

How to send DTO list using Retrofit2 in Android?

I'm studying Android programming using Kotlin. I am currently in the process of communicating with the server using Retrofit2. One of the data that needs to be passed to the server side is a list with ...
blonded's user avatar
  • 21
2 votes
1 answer
60 views

Can I send file and string data in one list to server using Retrofit2?

I'm a student studying Android programming. I am currently working on a project to make an app. I am currently in the process of communicating with the server using Retrofit2. I have to send a list of ...
blonded's user avatar
  • 21
0 votes
2 answers
39 views

How do I resolve this NullPointerException related to retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall

I am trying to make a Pokedex app that fetches pokemon data from API using retrofit2. It logs the following error when I try to run it Error: FATAL EXCEPTION: main ...
Soham Chougule's user avatar
0 votes
0 answers
33 views

Missing annotations for retrofit interace when using minifyEnabled

When running a build without minifyEnabled (debug build) everything works just fine, but when building with minifyEnabled there is a runtime error when calling to Repository.getData. The error is ...
RusArtM's user avatar
  • 1,204
1 vote
1 answer
82 views

GlobalExceptionHandler with @ExceptionHandler or ResponseEntity for REST answer from the server?

I've found two approaches of returning error status codes from RESTful API: the first is traditional using ResponseEntity<>. The second one is to create specific exceptions for status codes and ...
Crystal2033's user avatar
0 votes
0 answers
16 views

how to use Dynamic BaseUrl in Retrofit withhilt

I'm using retrofit in my project with hilt. so, i need to get baseUrl from user everytime he came in and call a webservice with that baseUrl. I create my hilt Module Class with Singleton component, ...
Sam Sirvan's user avatar
0 votes
1 answer
56 views

Why is my retrofit call returning null when it works on postman?

I'm trying to use Retrofit with the pokeapi (https://pokeapi.co/api/v2/) and it isn't working, I don't get what i'm doing wrong, since I already tested the call on Postman and it is not working This ...
Kalaitos Ornitier's user avatar
0 votes
1 answer
29 views

Unable to add bearer token in API client

I am trying to add bearer token in the API request but token not added. Here is my code: object APIClient { val client: ApiInterface get() { val httpLoggingInterceptor = ...
Techno World's user avatar
1 vote
0 answers
52 views

body parameters not being sent with retrofit POST request

I am trying to send one object to api (using Retrofit) with POST request from my android app but the parameters are not being sent. The retrofit interface function is as follows: @POST(URLs.REGISTER) ...
user1Tech's user avatar
-1 votes
1 answer
32 views

Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $. Retrofit2 Android [duplicate]

can you help me with the code? I don't understand what else needs to be done. I've tried everything and now I don't understand what else can be done there. I need to get the 'entries' array to ...
IbremMiner837's user avatar
0 votes
0 answers
29 views

Issue fetching data from DataStore, but using Shared preferences everything works

My problem is that when using DataStore, the data is saved correctly and updated correctly every time, but it is read incorrectly. ( I open applicationB from applicationA and I am passing data with ...
Cuyer's user avatar
  • 107
0 votes
2 answers
59 views

How can I fix the error in Retrofit 2? I have an error sending a request

I don't understand where the error is. My project has REGISTER section. I need to get the email and send it to AuthService. This image shows the error: This is my AuthService: This is a sample ...
Jamshid_5818's user avatar
1 vote
0 answers
48 views

Type mismatch. Required: Callback<AuthenticationResponse!>! Found: ` `

There is error in my code in this line .enqueue(object : Callback<AuthenticationResponse> Type mismatch. Required: Callback<AuthenticationResponse!>! Found: ` ` I am trying to call a ...
Dana's user avatar
  • 11
0 votes
1 answer
54 views

How to fix cannot resolve symbol android studio

I'm extremely new to android development and have been pulling my hair out basically to try and fix this error i have been having when i attempt import retrofit2 for instance i get an error like (...
WordedCrib's user avatar
0 votes
1 answer
41 views

Unable to return Array list added into retrofit enqueue method [duplicate]

I try to add arrays into a an array inside retrofit enqueue method. but it doesn't return array. i have codes like below. i don't know what mistake i made. private fun getAllAudio():ArrayList<Music&...
coppersmith's user avatar
0 votes
0 answers
25 views

About 424 error while post json using retrofit in android studio to azure API

I got some problems when I wanted to use POST API Method to Azure API, I thought I'd write code correctly but that was still wrong, I've tested the POST API using Postman, and that was successful, but ...
YCShimarin's user avatar
0 votes
1 answer
23 views

Retrofit Error: Expected a string but was BEGIN_OBJECT at line 1 column 92 path $.belongs_to_collection

I need to make a call to an api to receive details of a movie via an ID. When I make the first call, it works normally. If the second call has the same ID as the first call it also works, and so on if ...
Antony Lajes's user avatar
0 votes
1 answer
32 views

How do I create a pojo class if I have a JsonArray and a dynamic JsonObject in a JsonArray?

The following issue occurred while calling api using Retrofit on Android Response json [ { "test1": 10, "test2": 20, "test3": 37, "test_list": ...
SangSun's user avatar
  • 11
0 votes
0 answers
346 views

How to upload image file using retrofit with jetpack compose android

I want to upload image file on server using retrofit2 in android jetpack compose. I try but i can't do this. My code is here # api interface** interface ImageService { @Multipart suspend fun ...
asmatullah khan's user avatar
0 votes
1 answer
62 views

What are the disadvantage of declaring all request parameter of an endpoint?

Since Kotlin enables us to define default values for a method's parameters and lets us optionally pass parameters by their name, I prefer to define all the endpoint request parameters when declaring ...
Mohammad Reza Khahani's user avatar
0 votes
0 answers
26 views

How can I solve Retrofit generic methods problem

I wrote a method that will receive data from the API generically for the model classes that I will send using the Retrofit package. However, normally when doing it with a static model, data comes, but ...
avcismail's user avatar
0 votes
1 answer
101 views

Problem with mutableStateFlow retrofit and jetpack compose

I use MutableStateFlow and get data from server i need username text on my screen In onCreate() i get profile method from viewModel and in log.d my data is correct, but textUserName not update in ...
Alexey's user avatar
  • 17
1 vote
0 answers
28 views

Coroutine Flow sudden cancellation with Retrofit2

In our fragment we have this code inside onViewCreated. with(viewModel) { viewLifecycleOwner.collectShared(newsState, ::onNewsStateChanged) // Initial fetch fetchNews( ...
Bitwise DEVS's user avatar
  • 2,673
1 vote
0 answers
34 views

How to upload large video of size may be 400MB like that video to server using retrofit Android kotlin?

Using this code I can only upload small video which is also show corrupted if I try to download from server and play private fun uploadVideo(file: File) { CoroutineScope(Dispatchers.IO)....
Get Success's user avatar
1 vote
0 answers
49 views

Custom spinner using TextInputLayout and AutoCompleteTextView for Country,State and District

I am working on multiple Custom Spinner using TextInputLayout and AutoCompleteTextView and i want to select data accourding to above spinner validate in parrallel thread like when i select country ...
Raja Mali's user avatar
0 votes
0 answers
29 views

Error: com.example.uklon_android D 400 Bad Request when sending a photo to the server

Throws a 400 Bad Request error when sending a photo to the server. I am sending via retrofit 2 to the server. I download the photo from my phone in png format and try to upload it to the server. ...
Владислав Мельник's user avatar
0 votes
1 answer
82 views

How is Retrofit 2 processing the functions annotations from the API service interface passed to retrofit.create()?

I'm new to programming in Java and try to understand how annotations works in big libraries. Can someone show me code snippet in which retrofit is actually processing the functions annotations from ...
1Sayd's user avatar
  • 3
0 votes
1 answer
18 views

continue the network operation after user go back from calling activity

I'm working on a social application, where user can send media, now when user is on the chat activity user select and send a video /photo, we are using retrofit for network operation, we are uploading ...
Ipshita Sardar's user avatar
0 votes
2 answers
47 views

Android Retrofit multipart request with two parts

I am learning the use of Retrofit2 to make REST Api calls from Android app. I have an end point which accepts two parts as given below: @Multipart @POST("user/personImageUpload5") ...
Nazir's user avatar
  • 175
0 votes
1 answer
61 views

Android Retrofir2 Multipart remote API call set content type to 'application/json'

I have the following remote REST api call in my Android Retrofit2 app. @Multipart @POST("user/testupload") suspend fun uploadUImage( @Part person: PersonFull, @...
Nazir's user avatar
  • 175
2 votes
1 answer
782 views

getting unexpected json token at offset 0 with kotlin.serialization

Trying to parse json string from here, however kotlin serialization is throwing this error:kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected ...
lvm12's user avatar
  • 23
0 votes
0 answers
49 views

How to upload files to bunnyCDN storage zone using retrofit kotlin Android?

I want to upload a video to BunnyCDN using Retrofit in Android Kotlin, but getting crashes and error is not specified properly in Android Studio. Where I have made the mistake Here is the ...
Bhaskar Jyoti Dutta's user avatar
0 votes
1 answer
28 views

Dynamic JSON Response parsing to GSON model - Dynamic Key with Dynamic Data type

I have a JSON response structured as follows: { "status": true, "data": { "Owner": { "owner_name": "name", &...
user avatar
0 votes
0 answers
35 views

Retrofit request body as a data class not working

In my project I using the retrofit for API request. When I send the request through @Field params it's working fine. But the same request, same code I make data class instead of @Field params my ...
Ranjithkumar's user avatar
  • 16.6k

1
2 3 4 5
152