CLEARTEXT communication to host not permitted by network security policy
Android 9+ blocks plain http:// requests by default; the app tried to call a non-HTTPS URL.
CLEARTEXT communicationnot permitted by network security policyCleartext HTTP traffic to Meaning
Since API 28, cleartext traffic is disabled unless explicitly allowed. It typically hits local development servers (http://10.0.2.2:3000) or old APIs without TLS.
Common causes
- API base URL uses http://
- Local dev server accessed over HTTP from emulator/device
- Third-party SDK calling an HTTP endpoint
- Redirect from https to http
⚡ Quick fix
- Use HTTPS for production APIs
- For development only, allow cleartext for specific hosts via network security config
- Avoid
android:usesCleartextTraffic="true"app-wide in release builds
Detailed fix by platform
Android
- res/xml/network_security_config.xml (debug hosts only):xml
<network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="false">10.0.2.2</domain> <domain includeSubdomains="false">localhost</domain> </domain-config> </network-security-config> <!-- AndroidManifest: <application android:networkSecurityConfig="@xml/network_security_config" … > -->
How to diagnose
- URL — Which host/URL is http?
- Build — Debug only or also release?
- Redirects — Any https→http redirect?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Android
- Could not resolve Gradle: Could not resolve all files for configuration / Could not resolve dependency
- Unsupported class file major version Gradle: Unsupported class file major version / Android Gradle plugin requires Java 17 to run
- INSTALL_PARSE_FAILED_NO_CERTIFICATES INSTALL_PARSE_FAILED_NO_CERTIFICATES / App not installed as package appears to be invalid
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 11 Oct 2026