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

查看:29
本文介绍了签名 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.

但同样的事情,如果我使用签名 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.

在谷歌上没有得到任何解决方案.

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天全站免登陆