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.
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
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With