Skip to content

Guides

ERR_CLEARTEXT_NOT_PERMITTED in a Website App: Why HTTPS Sites Still Hit It

Your site loads fine in Chrome, but the app shows a cleartext error. Here is what Android is blocking, why a redirect or one old link can trigger it on an HTTPS site, and how to find the culprit in a minute.

9 min read

net::ERR_CLEARTEXT_NOT_PERMITTED means the app tried to load a page over plain HTTP, and Android blocks that by default for apps targeting Android 9 (API level 28) or higher. It can show up even when your website uses HTTPS, because a redirect hop or a hard-coded link can still point at http://. The fix is to make every URL the app can reach use HTTPS, not to switch the protection off.

What does net::ERR_CLEARTEXT_NOT_PERMITTED mean?

Cleartext is Android's word for unencrypted HTTP traffic. According to Android's network security configuration documentation, apps targeting Android 8.1 (API level 27) or lower allow cleartext by default, while from Android 9 (API level 28) it is disabled by default and an app has to opt in. The error page is what an app's web view shows when a page request runs into that block.

The confusing part is that your site works in a normal browser. Developers on Stack Overflow report that the same http:// address loads fine in Chrome, and Kinsta's explainer on this error notes it only appears in apps that use WebView. A browser typically shows a Not Secure warning for plain HTTP; an app targeting a modern Android version refuses the request instead.

Target API 27 or lower

Allowed

Cleartext on by default (Android docs)

Target API 28 or higher

Blocked

Cleartext off by default (Android docs)

http:// images, audio, video

Upgraded

Browser rule per MDN; IP-address hosts are blocked

http:// scripts, CSS, iframes

Blocked

Browser rule per MDN

Why do I get it when my website already uses HTTPS?

Because the app does not only load the address you typed. It follows redirects and links, and each request is checked on its own. These are the four patterns behind most reports.

Four patterns behind the error on sites that look like HTTPS (mixed-content rules are browser rules per MDN)
What you seeLikely causeFix
Error on the very first load of an https:// addressA redirect passes through http://. One Stack Overflow answer describes yourdomain.com redirecting to http://www.yourdomain.com and only then to https://www.yourdomain.com, with the app blocked at the first hop.Redirect every entry URL straight to the final https:// address in one step.
Error after tapping a menu item, button or bannerThat link is hard-coded as http://. MDN notes that top-level navigations to insecure pages are not classed as mixed content, so your browser console may stay quiet about it.Change the link to https://, or add a site-wide redirect to HTTPS.
Page loads, but parts of it are missingMixed content. Per MDN, browsers block insecure scripts, stylesheets, iframes, fetch and XHR requests and web fonts. Images, audio and video are upgraded to HTTPS unless the URL uses an IP address, in which case they are blocked.Use https:// URLs for every resource, or send a Content-Security-Policy: upgrade-insecure-requests header.
Error on a test or staging address such as http://10.x.x.x:9090A plain-HTTP address on a local network or test server. One Stack Overflow poster hit this error with exactly that kind of address.Test against an HTTPS domain. A plain-HTTP address will fail in an app that has not opted in to cleartext.

How do I find the http:// hop in a redirect chain?

You can check from any computer in a minute, without touching the app. In a terminal, run: curl -sIL http://yourdomain.com | grep -iE "^(HTTP|location)". Replace the domain, then repeat for the https:// address and for the www version of each. The output lists every response status and every Location header on the way to your final page. Any Location line that starts with http:// is a hop an app with cleartext turned off cannot follow.

  1. 1

    Test all four entry points

    Run the curl check for the http:// and https:// versions of your bare domain and your www domain.

  2. 2

    Read every Location line

    Note any redirect target that begins with http://, including the middle hop of a longer chain.

  3. 3

    Fix the redirect rules

    In your host, CDN or server settings, send each entry URL straight to the final https:// address.

  4. 4

    Hunt for hard-coded links

    Search your templates, menus and CMS content for http:// links to your own domain and change them to https://.

  5. 5

    Check the console for mixed content

    Open your site in a desktop browser with developer tools open and look for warnings about insecure resources. MDN notes the console reports when mixed content is upgraded or blocked.

  6. 6

    Retest on a real phone

    Install the app build on an Android phone and tap through the main sections, not only the home page.

Plain-HTTP pages cause trouble beyond this error. Location requests are one example, covered in WebView file upload not working.

Should I just allow cleartext traffic instead?

You will see advice to set android:usesCleartextTraffic="true" or a cleartextTrafficPermitted rule. Android's documentation confirms that apps targeting Android 9 or higher can opt in, per domain or for everything, and it says the all-domains setting is insecure and should be avoided whenever possible. Android's guidance on cleartext risks explains why: anyone monitoring the network can read and change cleartext traffic, which can include passwords and payment details. One forum reply to this very error calls the flag a temporary fix.

If your app comes from a website-to-app builder, you may not have access to the app's manifest at all, which is another reason to fix the site rather than the app. Fixing HTTPS also removes the Not Secure warning that browsers show on plain-HTTP pages.

What should I check after fixing it?

Once every URL loads over HTTPS, work through the rest of the mobile fixes for a website app. An app that fails on first load is also the kind of broken functionality that can be sent back in review, so read why Google Play rejects WebView apps before you submit.

Frequently asked questions

What does net::ERR_CLEARTEXT_NOT_PERMITTED mean?
The app tried to load a page over unencrypted HTTP and Android blocked it. Per Android's documentation, cleartext is disabled by default for apps targeting Android 9 (API level 28) or higher, so the page never loads unless it is served over HTTPS.
Why do I get this error when my site uses HTTPS?
A redirect or link in the chain is probably still http://. A common case is yourdomain.com redirecting to http://www.yourdomain.com before reaching https://www.yourdomain.com. Test each entry URL with curl and fix any hop that begins with http://.
Does the error happen in Chrome too?
Not as a block. Developers report that the same http:// address loads in Chrome, and browsers typically show a Not Secure warning instead. The hard block applies to apps that use WebView and target Android 9 or higher.
Is android:usesCleartextTraffic="true" a safe fix?
Android's documentation says allowing cleartext for all domains is insecure and should be avoided whenever possible. It can unblock a test, but serving every page over HTTPS is the lasting fix.
Why is my app blank on HTTPS instead of showing this error?
A blank page is a different symptom with several possible causes. Mixed content can leave parts of a page missing, so check your browser console for insecure resource warnings, and confirm the site loads normally in a mobile browser first.