Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Cleartext HTTP traffic not permitted

Tags:

flutter

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.

like image 839
JoeGalind Avatar asked Dec 06 '25 18:12

JoeGalind


2 Answers

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

like image 196
Faisal Ahmed Avatar answered Dec 08 '25 12:12

Faisal Ahmed


Please add below code in your manifest file both

main-AndroidManifest

 <application
        android:label="vvp"
        android:usesCleartextTraffic="true"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">

debug-AndroidManifest

<application android:usesCleartextTraffic="true" />
like image 45
Aditya Nandardhane Avatar answered Dec 08 '25 11:12

Aditya Nandardhane