Warning: Your Flutter application is created using an older version of the Android embedding.

在运行一个旧的flutter项目时,报错:Warning: Your Flutter application is created using an older version of the Android embedding. It's being deprecated in favor of Android embedding v2.

解决办法:

  1. 打开android目录下的app文件夹下的AndroidManifest.xml文件,在activity标签的下面增加如下代码:

    <meta-data
         android:name="flutterEmbedding"
         android:value="2" />
    
  2. android:name="io.flutter.app.FlutterApplication" 改为 android:name="${applicationName}"

  3. 在app/build.gradle的defaultConfig 中加这一句:

    manifestPlaceholders = [applicationName: "android.app.Application"]
    

猜你喜欢

转载自blog.csdn.net/Jackson_Wen/article/details/126556385
今日推荐