[Flutter] Error:Build failed due to use of deprecated Android v1 embedding.

2024. 1. 20. 08:42dev/flutter

728x90
반응형

Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. To migrate
your project, follow the steps at

 

Build failed due to use of deprecated Android v1 embedding.

 

 

I don't know this error warning.

so I open my android project. that have not AndroidManifest.xml file.

 

 

so I create AndroidManifest.xml file.

and add this required error comment.

The detected reason was:

  No `<meta-data android:name="flutterEmbedding" android:value="2"/>

 

 

my android project is strange.. 

so I run this commend.

 

flutter create --platforms -android .

 

 

this error issue. had not AndroidManifest.xml file.

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="image_editor"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:requestLegacyExternalStorage="true">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            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">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme"
                />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>
728x90
반응형

'dev > flutter' 카테고리의 다른 글

[Flutter] http, https  (0) 2024.01.20
[Flutter] ImagePicker, GallerySaver #camera #gallery  (0) 2024.01.20
[Flutter] GestureDetector  (0) 2024.01.20
[Flutter] SnackBar  (0) 2024.01.18
[Flutter] Splash  (0) 2024.01.17