First, check whether your retrofit configuration is correct and resolve the exception
.addconverterfactory (gsonconverterfactory. Create()) is modified here to the gson’s
Retrofit retrofit = new Retrofit.Builder() .baseUrl(HTTP_URL) .client(getOkHttpClient()) .addConverterFactory(GsonConverterFactory.create()) //Replace the converter, the return value is directly String, easy to parse the same field of different types of json data yourself .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build();
If this position is like this, report an error
Check whether your API path is correct, and see if there is a missing ‘/’ or something
Read More:
- MalformedJsonException:Use JsonReader.setLenient(true) to accept malformed JSON at line 3 colum
- c# Newtonsoft.Json.JsonReaderException: ‘Error reading JArray from JsonReader. Path ‘‘, line 0
- Error reading JSON file: json.decoder.JSONDecodeError : Extra data: line 6 column 2 (char 1329)
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- JSON data format net.sf.json .JSONException: A JSONObject text must begin with ‘{‘ at character 1 of Error:(f…
- Unable to read workspace file ‘D:\angular.json‘: Invalid JSON character: “ “ at
- Error resolution of unexpected token in JSON at position 0
- Parsing double quotation marks with JSON
- How to use scanner to accept char type characters in Java
- JS error: unexpected token u in JSON at position 0
- Unexpected token u in JSON at position 0
- How to query the production environment logstash report error parsing JSON
- 【ipfs-api】npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
- Unexpected token o in JSON at p
- [TS] solutions to line 0: parsing error: cannot read property ‘map’ of undefined
- Parsing the exception of storing JSON string in cookie
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing
- Error: syntax error – unexpected token P in JSON at position 0
- [system]SyntaxError: Unexpected token u in JSON at position 0
- [Solved] VUE Error: “You may use special comments to disable some warnings.Use // eslint-disable-next-line to …