[Flutter] 환경설정 중 만난 에러, 시간 먹는 괴물들~
짧은 제주도 여행 이후, 만들고 싶은 것이 생겼다. 추후에는 이 아이디어를 웹 방식으로도 만들고 싶지만, 당장은 앱 방식이 필요하다. 사실 앱 만드는 방법은 전혀 모른다. 공부해 본 적이 없다. 그래도 관심은 있어 Flutter를 알고는 있었다. Flutter에서 만들면 안드로이드든 IOS든 플랫폼에 상관없이 배포가 가능하다. 그리고 UI 디자인에 상대적으로 노력을 덜 들여도 완성도 높은 디자인을 뽑을 수 있다(그렇게 들었다). Flutter도 모르고 Dart 언어도 모르지만 무작정 시작하게 된 이유이다.
설치부터, 환경설정부터 몇 가지 에러로 인해 고통받았다. 나의 미래(이놈의 망각 때문에)와 누군가의 미래가 시행착오를 겪지 않도록 그것들이 무엇이었으며, 어떻게 해결했는지 기록해 두고자 한다.
flutter doctor의 이슈 2가지
Flutter와 안드로이드 스튜디오를 설치하고 난 후 "flutter doctor"를 통해 몇 가지 이슈들이 확인되었다.
C:\Users\J>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19042.1466], locale ko-KR)
[!] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.2)
[√] Connected device (2 available)
! Doctor found issues in 1 category.
1. cmdline-tools component is missing
"cmdline-tools component is missing"은 Android SDK Command-line Tools 인스톨로 해결할 수 있다.
2. Some Android licenses not accepted
"Some Android licenses not accepted" 문제는 CMD 창에서 "flutter doctor --android-licenses" 입력하고 엔터를 누르면 해결된다. 다만 "cmdline-tools component is missing" 문제가 해결되지 않은 상태에서는 이 문제가 해결되지 않는다.
가상 디바이스(AVD) 실행 에러
AVD 매니저에서 가상 디바이스를 생성하였고, 검색 및 선택도 된다. 하지만 실행 시 위와 같은 에러가 발생하였다. vulkan-1.dll과 관련되어있다. 이 문제는 다음과 같은 방법으로 간단히 해결할 수 있다.
C:\Users\(사용자 계정명)\.android ※ 디렉터리 위치는 개인별로 다를 수 있으니 확인 요망
위 폴더에 다음의 내용을 포함하고 있는 "advancedFeatures.ini" 파일을 생성하면 에러가 사라진다.
Vulkan = off
GLDirectMem = on
(출처: 플러터로 세계 정복)