3

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
  • 14,486
  • 4
  • 43
  • 54
StephanC
  • 67
  • 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

1 Answers1

7

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
  • 865
  • 1
  • 12
  • 22