0

I have developed one school app which communicates with ERP developed in .net. I am facing issue in some latest devices on which my apk gets installed but app is not allowing user to logged in with student. But if I logged in with same student on another device app allows user to logged in. I am seriously not getting this issue.

enter image description here

I am getting error java.io.IOException: Cleartext HTTP traffic to (my static IP) not permitted when I run my app on Pixel_2_XL_API_28 emulator

Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
mi5 pune
  • 1
  • 4

1 Answers1

0

I cant place your exact problem although. I had this same issue with devices that are using android pie hope this is your issue as well if you are using http instead of https in the api calls devices running android pie shows this login problem.So my solution for this problem is create a resource directory inside your res folder choose the resource type as xml and inside that folder create an xml resource file and name it as network_security_config insert the following code to that xml resource file

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">www.example.com</domain>
        <domain includeSubdomains="true">http://example.com</domain>
        <domain includeSubdomains="true">example.com</domain>   
    </domain-config>
</network-security-config>

and insert the following lines to your manifest inside the application tag

 android:networkSecurityConfig="@xml/network_security_config"
    android:usesCleartextTraffic="true"

hope this solves your problem

Dhyan V
  • 621
  • 1
  • 8
  • 18