On an Android 10 device, I get an ERR_CLEARTEXT_NOT_PERMITTED error in webview on my http server, but only on some pages, and even though I am using network_security_config to allow the domain. I am only able to work around the error by opening up all domains using . How can I fix this so only my domain is permitted, and not receive the error, but without using ?
Logcat:
07:54:09.004 com.myserver.myapp D/myapp: Webview.onPageStarted called on http://myserver.com/myapp/index.php?view=discrete
07:54:09.232 com.myserver.myapp I/myapp: onPageFinished called.
07:54:15.938 com.myserver.myapp D/myapp: Webview.onPageStarted called on http://myserver.com/myapp/index.php?view=about
07:54:15.958 com.myserver.myapp I/myapp: onReceivedError called.
07:54:15.958 com.myserver.myapp I/myapp: Web Load Error:net::ERR_CLEARTEXT_NOT_PERMITTED
07:54:16.012 com.myserver.myapp I/myapp: onPageFinished called.
Network-security-config xml:
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">myserver.com</domain>
</domain-config>
<!-- Want to delete this for better security-->
<base-config cleartextTrafficPermitted="true"/>
</network-security-config>