Understanding the ERR_CLEARTEXT_NOT_PERMITTED Error
If you've recently upgraded to Cordova Android 8, you may have encountered the frustrating net::ERR_CLEARTEXT_NOT_PERMITTED error. This message indicates that your application is trying to make unsecured HTTP requests, a practice that is increasingly discouraged in modern web and mobile development.
Why This Error Occurred After the Upgrade
The introduction of clearer security policies in Cordova Android 8 was aimed at enhancing the security of applications by default. Specifically, Android 9 and later reinforce the restriction on cleartext network traffic, which means that any requests made via HTTP instead of the more secure HTTPS will be blocked, leading to this error.
How to Fix the ERR_CLEARTEXT_NOT_PERMITTED Error
To resolve this issue, you have several options. You can either configure your app to allow cleartext traffic for specific domains or, ideally, switch to using HTTPS. Here are effective methods to fix it:
Ways to Address This Error
- Edit the AndroidManifest.xml to allow cleartext traffic
- Switch from HTTP to HTTPS for all requests
- Use a network security configuration file to specify exceptions
Editing AndroidManifest.xml
If you choose to allow cleartext traffic temporarily, you'll need to modify your AndroidManifest.xml file. Here's how:
AndroidManifest.xml Configuration
<application android:networkSecurityConfig="@xml/network_security_config">
...
</application>
Creating a Network Security Configuration File
If you prefer more granular control over your network settings, creating a network security configuration file is a recommended approach. This way, you can specify domain exceptions without broadly allowing cleartext traffic.
Example of Network Security Configuration
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">yourdomain.com</domain>
</domain-config>
</network-security-config>
Benefits of Switching to HTTPS
While allowing cleartext traffic can solve your immediate issue, we highly recommend upgrading your requests to HTTPS. Not only does this enhance security by encrypting data, but it also improves your application's credibility, potentially boosting user trust and engagement.
When to Seek Help from Experts
If you're finding it challenging to solve the ERR_CLEARTEXT_NOT_PERMITTED issue, consider outsourcing your Cordova development work. At ProsperaSoft, we have a team of expert developers ready to assist you in navigating these upgrades and ensuring your application is secure and functional.
Just get in touch with us and we can discuss how ProsperaSoft can contribute in your success
LET’S CREATE REVOLUTIONARY SOLUTIONS, TOGETHER.
Thanks for reaching out! Our Experts will reach out to you shortly.




