小编Ale*_*lex的帖子

改造:预计BEGIN_OBJECT但是BEGIN_ARRAY

很抱歉还有一个关于此错误的问题,但我读过的所有内容对我来说都无能为力.

我正在使用Retrofit Library和GSON来解析JSON答案.我收到了这个错误:

E/RETROFIT ERROR? com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
Run Code Online (Sandbox Code Playgroud)

JSON回答:

[
  {
"route_id": 16,
"typeofmovement_name": "Type name",
"route_description": "Just default description and no more",
"route_name": "Default name",
"route_img_url": "place reserved for url",
"themes": [
  "Theme name one",
  "Theme name two"
],
"routeparts": [
  {
    "rp_id": 32,
    "part_id": 1,
    "rp_start_latitude": "59.935353200891576",
    "rp_start_longitude": "30.31521778553724",
    "rp_end_latitude": "59.93948523234933",
    "rp_end_longitude": "30.314136184751987",
    "rp_description": "Default Description",
    "rp_title": "Default Title"
  },
  {
    "rp_id": 33,
    "part_id": 2,
    "rp_start_latitude": "59.93948523234933", …
Run Code Online (Sandbox Code Playgroud)

android json gson retrofit

3
推荐指数
1
解决办法
7492
查看次数

标签 统计

android ×1

gson ×1

json ×1

retrofit ×1