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

When running an old flutter project, an error is reported:Warning: Your Flutter application is created using an older version of the Android embedding. It's being deprecated in favor of Android embedding v2.

Solution:

  1. Open the AndroidManifest.xml file under the app folder in the android directory, and add the following code below the activity tag:

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

  3. Add this sentence in the defaultConfig of app/build.gradle:

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

Guess you like

Origin blog.csdn.net/Jackson_Wen/article/details/126556385
Recommended