10

I have gone through the usual answers. I have edited the info.plist on iOS and added the network_config.xml in Android. This works perfectly when running the project from XCode, but when trying to run the debug from Android Studio, I get the

Cleartext HTTP traffic to 192.168.1.54 not permitted

Seems like Flutter is ignoring my iOS and Android configurations regarding this matter, but only when running it directly from Android Studio.

JoeGalind
  • 3,545
  • 2
  • 29
  • 33

1 Answers1

22

Please add below code in your manifest file

<?xml version="1.0" encoding="utf-8"?>
 <manifest ...>
 <uses-permission android:name="android.permission.INTERNET" />
 <application
    ...
    android:usesCleartextTraffic="true"
    ...>
    ...
</application>
</manifest>

You can read details here https://medium.com/@imstudio/android-8-cleartext-http-traffic-not-permitted-73c1c9e3b803

Faisal Ahmed
  • 816
  • 9
  • 12