Flutter Insecure Http Is Not Allowed by Platform

Insecure HTTP is not allowed by platform in Flutter IOS

You added wrong strings to info.plist file.

Just replace this:

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

by this:

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

Bad state: Insecure HTTP is not allowed by platform: http://0.0.0.0:9090

Open the AndroidManifest.xml file in the android/app/src/main folder.

Then set usesCleartextTraffic to true.

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

How to solve insecure http not allowed by platform flutter?

To temp fix your problem. First add a config in res/xml(my full path is /Users/dolphin/source/third-party/Cruise/android/app/src/main/res/xml) folder:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>

then in your AndroidManifest.xml file add this config:

android:networkSecurityConfig="@xml/network_security_config"

this could allow http traffic. But it just using to debug, the best way is to using https traffic. more info: How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?

It have solve my same problem. Hope this help for you!



Related Topics



Leave a reply



Submit