Flutter Insecure http is not allowed by platform

Generally it is required (and preferable) to use https links rather than http links. However, this can be overridden as shown below.

Android

Open the AndroidManifest.xml file in the android/app/src/main folder. Then set usesCleartextTraffic to true.

<application
    ...
    android:usesCleartextTraffic="true"
    ...   >

See this question for more.

iOS

Open the Info.plist file in the ios/Runner folder. Then add the following key.

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

See this answer for more.

macOS

This is the same as iOS. Open the Info.plist file in the macos/Runner folder. Then add the following key.

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

Leave a Comment