본문 바로가기
프로그램 개발해서 돈벌기/flutter

[flutter] Build failed due to use of deprecated Android v1 embedding. 를 만났을때 에러 수정 방법

by ubmuhan 2024. 1. 31.
반응형

 

 

"Build failed due to use of deprecated Android v1 embedding." 에러는 현재 플러터가 안드로이드 버전이 오래된 v1을 사용해서 발생한 문제입니다.

 

전체 에러 안내문


Warning

 

Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

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.


 

 

수정 방법은 간단합니다.

 

안드로이드 내 "AndroidManifest.xml" 파일을 수정하면 됩니다.

 

# 기존 "AndroidManifest.xml" 파일 내용

<application
    android:name="io.flutter.app.FlutterApplication"

 

 

위 내용을 다음과 같이 변경하면 됩니다.

 

# "AndroidManifest.xml" 변경

<application
    android:name="${applicationName}"

 

 

그리고 "<application " 내 "<meta-data />"를 다음과 같이 추가합니다.

 

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

 

 

변경 후 다시 컴파일을 진행하면 해당 에러가 발생하지 않은 것을 알 수 있습니다.

반응형

댓글