Build failed due to use of deprecated Android v1 embedding


If you are using Flutter and getting deprecated Android v1 embedding error then it means you are building an older version of your project.

According to Flutter Migration Guide

In order to better support the execution environments of adding Flutter to an existing project, the old Android platform-side wrappers hosting the Flutter runtime at and their associated classes are now deprecated. New wrappers at and associated classes now replace them.

The complete error looks like this –

to migrate your project. You may also pass the --ignore-deprecation flag to .ignore this check and continue with the deprecated v1 embedding. However, the v1 Android embedding will be removed in future versions of Flutter.
The detected reason was:

  C:\Users\akash\OneDrive\Desktop\Project\myapp\app\android\app\src\main\AndroidManifest.xml uses

Build failed due to use of deprecated Android v1 embedding.


The migration is a 2 step process –

Step 1: Replace by in

Open android/app/src/main/java/[your/package/name]/ and confirm that it should look like this –


public class MainActivity extends FlutterActivity {


Or, if there is content in MainActivity, then it should look like this –

import androidx.annotation.NonNull;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;

 public class MainActivity extends FlutterActivity {
    private static final String CHANNEL = "";

    public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
        new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), CHANNEL)
                    (call, result) -> {
                        // Your existing code

Step 2: Open android/app/src/main/AndroidManifest.xml

a. Replace android:name="" with android:name="${applicationName}".

  <!-- Replace the below line 👇 -->
  <!-- android:name="" -->
  <!-- With this ☝️ -->
  <!-- Other code -->

b. Add meta-tag in <application> tag –

    android:value="2" />

  <!-- ☝️ Add this meta tag -->

These steps will solve the build failed issue and your app will run successfully.