4

I get ERR_CLEARTEXT_NOT_PERMITTED for Android and blank page for iOS when I use http:// URLs.

https:// URLs seem to work.

The very same http:// URLs work fine in Chrome.

I recall I had the same problem in native Android as well some year ago. Is it possible to tell webview "please use http://. I will take the risk"?

I'm using webview_flutter: ^0.3.2+1

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
StephanC
  • 97
  • 1
  • 1
  • 7
  • from a similar answer by @nimit check it here https://stackoverflow.com/questions/55592392/how-to-fix-neterr-cleartext-not-permitted-in-flutter – Mr. Adrien Feudjio Apr 23 '19 at 13:20
  • https://stackoverflow.com/questions/54752716/why-am-i-seeing-neterr-cleartext-not-permitted-errors-after-upgrading-to-cordo/56262624#56262624 – zardilior Jul 02 '19 at 03:40

2 Answers2

8

1) For Android check ./android/app/src/main/AndroidManifest.xml

<manifest ....
    ....
    **<uses-permission android:name="android.permission.INTERNET" />**
    <application
        **android:usesCleartextTraffic="true"**
    </application>
    ...
</manifest>

2) For ios you need to modify the info.plist ./ios/Runner/info.plist

Add the following:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

3) After that do flutter clean for your project.

kamartem
  • 994
  • 1
  • 12
  • 22
-2

I get the answer Ex: Url = http//:www.google.com/ change Url

        Url = http//:www.google.com

This is working fine

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/34689597) – Ram Chander Jul 21 '23 at 06:57