Android java.lang.illegalStateException:应为BEGIN_对象,但在第1行第1列路径$Rest api中为字符串失败

Android java.lang.illegalStateException:应为BEGIN_对象,但在第1行第1列路径$Rest api中为字符串失败,android,rest,Android,Rest,我的json响应 { "error": 200, "message": "New Admin", "adminUser": [ { "adminUserId": "9", "adminUserGmail": "sagevadiyagulabadada123&qu

我的json响应

{
    "error": 200,
    "message": "New Admin",
    "adminUser": [
        {
            "adminUserId": "9",
            "adminUserGmail": "sagevadiyagulabadada123",
            "companyName": "",
            "name": "",
            "signUpDate": "2020-12-12",
            "expiryDate": "2020-12-12",
            "mobileNumber": "70465524937",
            "phoneNumber": "7065424937",
            "subscriptionPlan": "free",
            "profilePicPath": "image path",
            "gstNumber": "24AADSA5640A1Z3",
            "companyBillingAddress": "Guajrat India",
            "companyShippingAddress": "Gujarat India"
        }
    ]
}
我的电话

    @Headers("Content-Type: application/json")
    @FormUrlEncoded
    @POST("insertAdmin.php")
    Call<GetLogInResponse> loginAdmin(
            @Field("adminUserGmail") String adminGmail,
            @Field("companyName") String companyName,
            @Field("name") String name,
            @Field("signUpDate") String signUpDate,
            @Field("expiryDate") String expiryDate,
            @Field("mobileNumber") String mobileNumber,
            @Field("phoneNumber") String phoneNumber,
            @Field("subscriptionPlan") String subPlan,
            @Field("profilePicPath") String profilePicPath,
            @Field("gstNumber") String gstNumber,
            @Field("companyBillingAddress") String billingAddress,
            @Field("companyShippingAddress") String shippingAddress
    );
我的模型对象响应

public class GetLogInResponse {

    @SerializedName("error")
    @Expose
    private int error;
    @SerializedName("message")
    @Expose
    private String message;
    @SerializedName("adminUser")
    @Expose
    private List<AdminUser> adminUser = null;

    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<AdminUser> getAdminUser() {
        return adminUser;
    }

    public void setAdminUser(List<AdminUser> adminUser) {
        this.adminUser = adminUser;
    }
}
公共类GetLogInResponse{
@SerializedName(“错误”)
@暴露
私有整数错误;
@SerializedName(“消息”)
@暴露
私有字符串消息;
@SerializedName(“adminUser”)
@暴露
私有列表adminUser=null;
public int getError(){
返回误差;
}
公共无效设置错误(int错误){
this.error=错误;
}
公共字符串getMessage(){
返回消息;
}
公共无效设置消息(字符串消息){
this.message=消息;
}
公共列表getAdminUser(){
返回管理员用户;
}
public void setAdminUser(列表adminUser){
this.adminUser=adminUser;
}
}
我的错误在toast中显示如下 java.lang.illegalStateException:应为BEGIN_对象,但在第1行第1列路径处为字符串$

java.lang.illegalStateException:应为BEGIN_对象,但在第1行第1列路径处为字符串$

我该怎么办?谢谢你的帮助

日志

注意:未定义索引:第9行/storage/ssd4/543/15633543/public\u html/insertAdmin.php中的adminUserGmail

警告:mysqli_num_rows()希望参数1是mysqli_result,布尔值在第14行的/storage/ssd4/543/15633543/public_html/insertAdmin.php中给出
I/okhttp.OkHttpClient:
注意:第30行/storage/ssd4/543/15633543/public_html/insertAdmin.php中未定义的索引:companyName
注意:第31行/storage/ssd4/543/15633543/public_html/insertAdmin.php中的未定义索引:name

注意:未定义索引:第32行/storage/ssd4/543/15633543/public_html/insertAdmin.php中的signUpDate
注意:第33行的/storage/ssd4/543/15633543/public_html/insertAdmin.php中未定义索引:expireydate
注意:第34行的未定义索引:mobileNumber in/storage/ssd4/543/15633543/public_html/insertAdmin.php

注意:未定义索引:第35行/storage/ssd4/543/15633543/public_html/insertAdmin.php中的phoneNumber

注意:未定义索引:第36行/storage/ssd4/543/15633543/public_html/insertAdmin.php中的subscriptionPlan

注意:第37行的/storage/ssd4/543/15633543/public_html/insertAdmin.php中未定义索引:profilePicPath
注意:未定义索引:第38行/storage/ssd4/543/15633543/public_html/insertAdmin.php中的gstNumber

注意:第39行的/storage/ssd4/543/15633543/public\u html/insertAdmin.php中未定义的索引:companyBillingAddress
注意:未定义索引:第40行/storage/ssd4/543/15633543/public\u html/insertAdmin.php中的companyShippingAddress
{“错误”:200,“消息”:“登录失败,请重试”,“管理员用户”:[]}
尝试使用改装拦截器。它将在日志中显示您的请求和响应,您可以看到您的响应有哪些错误

HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
        logging.setLevel(HttpLoggingInterceptor.Level.BODY);

OkHttpClient client = new OkHttpClient.Builder()
                .addInterceptor(logging)
                .build();

Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(Common.URL)
                .addConverterFactory(GsonConverterFactory.create())
                .client(client)
                .build();

谢谢你的提示。现在我在logcatI中遇到了问题,我发现当我在postman中尝试不包含内容长度的请求时,postman中也出现了相同的错误。如何在android应用程序请求中设置内容长度?
public class GetLogInResponse {

    @SerializedName("error")
    @Expose
    private int error;
    @SerializedName("message")
    @Expose
    private String message;
    @SerializedName("adminUser")
    @Expose
    private List<AdminUser> adminUser = null;

    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<AdminUser> getAdminUser() {
        return adminUser;
    }

    public void setAdminUser(List<AdminUser> adminUser) {
        this.adminUser = adminUser;
    }
}
    <b>Notice</b>:  Undefined index: adminUserGmail in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>9</b><br />
    <br />
    <b>Warning</b>:  mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>14</b><br />
I/okhttp.OkHttpClient: <br />
    <b>Notice</b>:  Undefined index: companyName in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>30</b><br />
    <br />
    <b>Notice</b>:  Undefined index: name in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>31</b><br />
    <br />
    <b>Notice</b>:  Undefined index: signUpDate in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>32</b><br />
    <br />
    <b>Notice</b>:  Undefined index: expiryDate in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>33</b><br />
    <br />
    <b>Notice</b>:  Undefined index: mobileNumber in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>34</b><br />
    <br />
    <b>Notice</b>:  Undefined index: phoneNumber in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>35</b><br />
    <br />
    <b>Notice</b>:  Undefined index: subscriptionPlan in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>36</b><br />
    <br />
    <b>Notice</b>:  Undefined index: profilePicPath in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>37</b><br />
    <br />
    <b>Notice</b>:  Undefined index: gstNumber in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>38</b><br />
    <br />
    <b>Notice</b>:  Undefined index: companyBillingAddress in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>39</b><br />
    <br />
    <b>Notice</b>:  Undefined index: companyShippingAddress in <b>/storage/ssd4/543/15633543/public_html/insertAdmin.php</b> on line <b>40</b><br />
    {"error":200,"message":"Login Failed Try Again","adminUser":[]}
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
        logging.setLevel(HttpLoggingInterceptor.Level.BODY);

OkHttpClient client = new OkHttpClient.Builder()
                .addInterceptor(logging)
                .build();

Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(Common.URL)
                .addConverterFactory(GsonConverterFactory.create())
                .client(client)
                .build();