Application working in local build, but not working in Live Environment(Production)

  • Replies:11
Umang Upadhyay
  • Forum posts: 6

Sep 24, 2021, 8:24:27 AM via Website

Hello, I am facing a problem with my native android application. Everything works fine when I am testing my app through local build apk in android studio. But the same application is not working properly in production(in play store). It was working fine few months ago, it suddenly started having issue in production. I have checked the logs of live app in android studio logcat by connecting the live app with android studio through USB cable, it shows some information and i can see that api is getting called and the response of the api is there, but screen doesn't move to next screen. At one other place i got an NullPointerException on an api call then i checked the same on local build and I did not got any NullPointerException.

Please suggest what should i do in order to resolve this issue i am facing with my app in production. Any suggestion or solution will be of great help, Thanks in advance.

Reply
chales_smith
  • Forum posts: 13

Sep 24, 2021, 9:08:26 AM via Website

Time for testing and find the bugs :)

Helpful?
Reply
Umang Upadhyay
  • Forum posts: 6

Sep 24, 2021, 10:40:02 AM via Website

I have tested the local build and it is working fine and for live app testing i have checked the logs and there is limited information in logcat, if you have any suggestions on how can i retrieve more information about the issue through logcat on android studio or what else i can try, please do tell.

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Sep 24, 2021, 11:09:57 AM via Website

It seems that the problem is that API call which returned NullPointerException.
First of all, investigate and clarify what the difference between the responses of this API to the two calling methods is.
For example, is some api temporarily unavailable from outside your LAN? ......

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Umang Upadhyay
  • Forum posts: 6

Sep 24, 2021, 12:47:44 PM via Website

Thanks @James Watson for responding. The response i am getting in logs for the api is same as when i call the api from POSTMAN.

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Sep 25, 2021, 11:35:48 AM via Website

You may write more logs in your web api codes in order to find why it will throw NullPointerException.

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Umang Upadhyay
  • Forum posts: 6

Sep 26, 2021, 8:41:37 AM via Website

Hey @James Watson can this be a problem related to proguard rules, I have proguard enable in my project but haven't added any rules in the proguard-rules.pro file. Should I add rules related to retrofit,okhttp etc.

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Sep 26, 2021, 8:57:01 AM via Website

Umang Upadhyay

Hey @James Watson can this be a problem related to proguard rules, I have proguard enable in my project but haven't added any rules in the proguard-rules.pro file. Should I add rules related to retrofit,okhttp etc.

I don't think this has anything to do with your issues.

In summary, now you have two questions in your production app as below, right?

  1. A web api (A) is getting called and the response of this api is there, but the activity doesn't change accordingly yet.
  2. You will get an NullPointerException on another web api call (B).

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Umang Upadhyay
  • Forum posts: 6

Sep 26, 2021, 9:46:31 AM via Website

James Watson

Umang Upadhyay

Hey @James Watson can this be a problem related to proguard rules, I have proguard enable in my project but haven't added any rules in the proguard-rules.pro file. Should I add rules related to retrofit,okhttp etc.

I don't think this has anything to do with your issues.

In summary, now you have two questions in your production app as below, right?

  1. A web api (A) is getting called and the response of this api is there, but the activity doesn't change accordingly yet.
  2. You will get an NullPointerException on another web api call (B).

Yes these are the problems i am facing and it is not just 2 apis, in whole application i am facing the problem apis are getting called 2 apis are giving NullPointerException , others are not. And also in those which are giving NPE the response is there, api is executed successfully after that logs are showing NPE.

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Sep 27, 2021, 5:37:06 AM via Website

Umang Upadhyay

James Watson

Umang Upadhyay

Hey @James Watson can this be a problem related to proguard rules, I have proguard enable in my project but haven't added any rules in the proguard-rules.pro file. Should I add rules related to retrofit,okhttp etc.

I don't think this has anything to do with your issues.

In summary, now you have two questions in your production app as below, right?

  1. A web api (A) is getting called and the response of this api is there, but the activity doesn't change accordingly yet.
  2. You will get an NullPointerException on another web api call (B).

Yes these are the problems i am facing and it is not just 2 apis, in whole application i am facing the problem apis are getting called 2 apis are giving NullPointerException , others are not. And also in those which are giving NPE the response is there, api is executed successfully after that logs are showing NPE.

I think you should add more logs in the codes of your app and those suspicious web apis. Thus you will figure out why the activity didn't change and why those API calls throwed NullPointerExceptions.

On the other hand, you may post some code snippets as well as other detailed information on the stackoverflow community for help.

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Umang Upadhyay
  • Forum posts: 6

Sep 27, 2021, 3:41:13 PM via Website

James Watson

Ok, thank you for your valuable advice it is a great help for me.

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Sep 28, 2021, 3:25:24 AM via Website

Umang Upadhyay

James Watson

Ok, thank you for your valuable advice it is a great help for me.

You are welcome, we all should help each other. (smug)

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
chales_smith
Reply