Flutter 属性:此处不允许usesCleartextTraffic

Flutter 属性:此处不允许usesCleartextTraffic,flutter,android-studio,Flutter,Android Studio,我用的是颤振。 Androidmanifest有此错误 这是我的Androidmanifest.xml文件 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.

我用的是颤振。 Androidmanifest有此错误

这是我的Androidmanifest.xml文件

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.freshfood">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <application
        android:label="freshfood"
        android:usesCleartextTraffic="true"
        android:hardwareAccelerated="true">
        <activity
            android:networkSecurityConfig="@xml/network_security_config"
            android:name=".MainActivity"
            android:icon="@mipmap/ic_launcher"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

            android:windowSoftInputMode="adjustResize">
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <meta-data android:name="io.flutter.network-policy"
                android:resource="@xml/network_security_config"/>

            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />

            <meta-data android:name="io.flutter.network-policy"
                android:resource="@xml/network_security_config"/>
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>

</manifest>

错误是

属性android:usesCleartextTraffic在此不允许, 属性android:此处不允许硬件加速, 属性android:networkSecurityConfig在此不允许,

我试着

  • androidmanifest.xml文件与grandle文件同步项目
  • 使现金失效/重新启动
  • 我真的不知道怎么解决它。请帮帮我。
    Android Studio版本是4.2.1。谢谢

    尝试将
    networkSecurityConfig
    移动到
    中。我移动了它,但得到了相同的错误ㅠㅠ将flift项目中的
    android
    目录作为一个单独的
    android项目打开
    &同步项目哦,分离项目没有错误,但原始项目中的清单文件仍然错误。。可以吗?谢谢