签名APK中的响应为空-调试APK中的响应为正确 [英] Null Response in Signed APK - Proper response in Debug APK

查看:80
本文介绍了签名APK中的响应为空-调试APK中的响应为正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Retrofit进行网络通话.

I am using Retrofit for network calls.

我遇到了带有签名APK的奇怪问题.

I am facing weird issue with signed APK.

改装请求

@FormUrlEncoded
@Headers("Accept: application/json")
@POST("******")
Call<UserInfoResponse> authenticateUser(@Field("umMobileNumber") String websiteId,
                                    @Field("spPassword") String loginSource);

在上述请求的响应中,如果我在调试版本上运行它,我将得到正确的响应.

In the response of the above request, I am getting the proper response, If I am running it on debug build.

但是如果我使用Signed APK,同样的事情,我在响应中得到一个空对象.

But the same thing if I do with Signed APK, I am getting a null object in the response.

下面的答复,

{
"isValid": true,
"accessToken": "",
"isValidToken": true,
"serviceBean": {
    },
"customerExist": false,
"singleSessionFlag": false
 }

在Singed Apk中,我将serviceBean设置为null.

In Singed Apk I am getting serviceBean as null.

在Google上找不到任何解决方案.

Not getting any solution on the google.

有人可以帮我解决这个问题吗?

Can someone help me out in resolving this?

推荐答案

请设置minify为false. (构建/编辑构建类型) 如果在代码发布时设置此选项,则会删除某些部分.

please set minify as false. (Build/Edit Buildtype) if you set this option when code release, some part is removed.

这篇关于签名APK中的响应为空-调试APK中的响应为正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆