Ionic 5/Capacitor ERR_CLEARTEXT_NOT_PERMITTED in Android
Solution 1:
Add this to you AndroidManifest.xml
in the application
element
<application
android:usesCleartextTraffic="true"
Solution 2:
When you specify the server
in your Capacitor config, you should set server.cleartext
to true
to prevent this issue from happening. Example:
{
"appId": "com.abc",
"appName": "abc",
"npmClient": "npm",
"server": {
"url": "http://192.168.1.208:8100",
"cleartext": true
}
}
This is not very well documented - the only place I found this configuration being used was on https://capacitorjs.com/docs/guides/live-reload