Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have uploaded an app to play store. On launching the app login page is shown but the web-service that does the login is not working. I have tested the app locally and everything works fine.
What could be have possibly gone wrong.

My web service uses http protocol so i added network_config_xml_file like this

<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">webservices.mydomain.com/vidyaMandir.svc</domain>
    </domain-config>
</network-security-config>


and added this property in manifest file as
android:networkSecurityConfig="@xml/network_security_config"


What I have tried:

Launched app to play store but web-service is returning null
Posted
Updated 27-May-20 18:42pm
v2
Comments
Richard MacCutchan 2-Apr-20 10:21am    
Any one of a million things could have gone wrong. But no one here could guess without some proper details.

Most likely you have a configuration problem.

If you expect more help... you actually are going to tell us more.

If this was my problem; I would start off by trying to call that webservice from a browser or by using a tool such as SoapUI or Postman.

If the web-service is not working, then fixing that should take care of your app as well.
If the web-service is working, then you need to make sure that your app has the correct pointer to the webservice, and not to something on your home network
 
Share this answer
 
Comments
Rahul Ramakrishnan 2-Apr-20 11:28am    
The web-service is working fine in Postman and chrome too. Its also working in my emulator and locally in my android device.
MadMyche 2-Apr-20 11:49am    
Where is the webservice located> In House or hosted elsewhere
Rahul Ramakrishnan 2-Apr-20 11:57am    
In house
MadMyche 2-Apr-20 12:02pm    
Try accessing the webservice from outside of the house... i am guessing it is not publicly accessible

Rahul Ramakrishnan 2-Apr-20 12:12pm    
it is publicly accessible
Quote:
My web service uses http protocol ...
That's a likely culprit. Passing user credentials over an unsecured network protocol is an extremely bad idea, and is likely to be blocked.

Update your web service to use HTTPS instead. Depending on where and how it's hosted, you may even be able to use a free certificate from Let's Encrypt[^], so it won't cost you anything.

NB: If it's hosted with a company that won't let you use a free certificate, then you should take your business elsewhere.
 
Share this answer
 
I added the following code to the proguard-rules-pro file
Java
-keepclassmembers,allowobfuscation class * {
    @com.google.gson.annotations.SerializedName <fields>;
  }
-keep,allowobfuscation @interface com.google.gson.annotations.SerializedName


Now it works
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900