Skip to main content

All Questions

Tagged with
0 votes
0 answers
25 views

com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonNull

var retrofitResponse: RetrofitResponse<APIResponse<User>>? = null withContext(Dispatchers.IO) { retrofitResponse = try { val response = ...
Krishna Dhas's user avatar
1 vote
2 answers
43 views

How to change root of JSON response before cast to typed entity?

Task The remote server returns a response with a body: { done: true, response: { result: { // data } } } In case of an error, a response with 200 status and a ...
Viewed's user avatar
  • 1,531
0 votes
0 answers
94 views

com.google.gson.stream.MalformedJsonException | Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

I'm encountering the following problem when sending an API request on my Android 10 device. The response to the request I sent to the API returns as follows: Actually, I am facing a crash issue ...
Erhan's user avatar
  • 35
0 votes
1 answer
61 views

Fetching Api returns Array of Arrays instead Array of Objects using Retrofit and Gson

Recently I have been working on project which includes working with API. I have checked it in Postman and I am sure that its response is an Array of Objects but when tried to use it I faced Expected ...
nima's user avatar
  • 13
0 votes
1 answer
118 views

"empty String" when parse json into model class in android with kotlin

I am Android developer, I am facing a problem while making an API call. I am receiving a huge amount of data, making an API call, and I get the API call success, I can see the JSON response in the ...
Urvish Stack's user avatar
0 votes
0 answers
25 views

Receiving an empty body in a retrofit response

I am using retrofit to get data from the ticketmaster API My class Event: `public class Event implements Parcelable { private String name; private String id; private String url; private String ...
Martina Kenna's user avatar
0 votes
0 answers
69 views

Why my MoshiConverterFactory is slower then GsonConverterFactory?

when I post an api, it took too many time to response Here is my retrofit builder: fun provideRetrofit(baseUrl: String): Retrofit = Retrofit.Builder() .client(provideOkhttpClient()) ....
aile's user avatar
  • 1
0 votes
0 answers
44 views

Adding GSONConvertorFactory to retrofit2 while calling an API

I have many API's which I am calling from my application. On response I have default GsonConvertorFactory which converts the JSON response to the corresponding Java objects with exact number and name ...
shubham's user avatar
  • 47
1 vote
2 answers
69 views

Parsing an API response with GSON and Retrofit, values remain null

My App class: class App( var id: Int, var name: String, var description: String, var url: String, var packageName: String, var appVersion: String, var iconMediaUUID: String?, var created: String, var ...
Adam Varhegyi's user avatar
0 votes
0 answers
38 views

java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ (Using hilt and MVVM acrh))

rocess: com.ashish.newswave, PID: 16941 java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ at com.google.gson.stream.JsonReader.beginArray(JsonReader....
Ashish Kamat's user avatar
0 votes
1 answer
76 views

retrofit2 parse a multiline json response

I'm trying to consume from an API that streams JSON object, one per line, using retrofit2. The response look something like this {"key":" value", ...} {"key":" value&...
bachr's user avatar
  • 5,978
0 votes
1 answer
81 views

How to match data class with JSON response from API in Retrofit?

data class Item( val calories: Int, val carbohydrates_total_g: Double, val cholesterol_mg: Int, val fat_saturated_g: Int, val fat_total_g: Double, val fiber_g: Double, val ...
AboKaid 999's user avatar
0 votes
1 answer
64 views

'Handshake Failed' error using Retrofit in kotlin

How can I fix this error? txt.text=t.Messag ====> Handshake Failed my main activity `fun getMyData(){ val Base_URL="https://tgju.amirhossein.info/" val retrofitBuilder= ...
Hos 8990's user avatar
0 votes
1 answer
520 views

How do i get data from a json object from api and populate a spinner in kotlin using retrofit?

I'm making an app that can read from Api and populate a kotlin spinner. isSuccesful and all response. extensions are not found, how do i fix it? This is the url i'm getting the json objects from: ...
Daki's user avatar
  • 13
0 votes
1 answer
400 views

Gson serializer for ZonedDateTime from java.time [duplicate]

I use Retrofit2 with Gson. I wrote a custom serializer for ZonedDateTime but it's not working. When I try to debug sending requests to the server, I see that the bugger does not enter the serialize ...
tasjapr's user avatar
  • 1,110

15 30 50 per page
1
2 3 4 5
48