-2

My application is working except in android 9 Pie. I dont see any error on my app and everything works well. I havent find any explanation about this error.

My Application got an error when after i log in to application and then it shows nothing but a blank black layout. Do anyone ever get this kind of error? Please help me. Thanks.

UPDATE 8/3/2019

i've found the answer, it is caused by newest requirement on android pie which is device cannot send data to server HTTP without set apache.http.legacy into andorid:required="false.

Iganov
  • 85
  • 2
  • 14

1 Answers1

1

I Recently had the same issue for Android 9, but I had to use some URLs for different screens. So I added android:usesCleartextTraffic="true" to Manifest and it worked, but we didn't want to compromise the security of the whole app for this. So the fix was in changing links from HTTP to https.But if you had to use only http to communicate with your app then here is your solution.

Add this in the Manifest file

android:networkSecurityConfig="@xml/security_config"

Add this in the Xml
<network-security-config>
<base-config cleartextTrafficPermitted="true"/>
<debug-overrides>
 <trust-anchors>
    <certificates src="system" />
    <certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
Brahma Datta
  • 1,102
  • 1
  • 12
  • 20