Potoclips.com | Android Webview Net: Cleartext error
Android webview net::ERR_CLEARTEXT_NOT_PERMITTED
Source: See the webpage
To allow all Network connection types HTTP and HTTPS in Android (9) Pie, need to follow the below two steps:
1) You now have to create a file named network_security_config just like the way you have named it in the AndroidManifest.xml in your xml folder.
2) You have to set android:networkSecurityConfig=”@xml/network_security_config” in the application tag of your AndroidManifest.xml of your android application which allow cleartext traffic to all Network connection types in Android 9 Pie.
Step 1. Create a new file res/xml/network_security_config.xml and the content of your file should be like this to enable all webview URL requests without encryptions:
Step 2. Add network security config created above to your Android manifest file under application tag.
More about Network security configuration:
can contain below tags:
0 or 1 of
Any number of
0 or 1 of
Here these tags are:
Any values that are not set in
The default configuration for applications which targets Android 9 Pie (API level 28) and higher is as follows:
The default configuration for applications which targets Android 7.0 Nougat (API level 24) to Android 8.1 Oreo (API level 27) is as follows:
The default configuration for applications which targets Android 6.0 Marshmallow (API level 23) and lower is as follows: