flutter android 中发送http请求后,默认会报错。需要修改配置文件。
network_security_config.xml<?xml version="1.0" encoding="utf-8"?>
AndroidManifest.xml
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_study"
android:icon="@mipmap/ic_launcher"
android:networkSecurityConfig="@xml/network_security_config">
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:name="flutterEmbedding"
android:value="2" />