Flutter upgrade 이후, 자동완성(AutoCompletion) 버그 발생

Uno·2023년 9월 12일
0

ErrorNote

목록 보기
4/6

문제 & 상황

flutter upgrade

이 명령어를 통해서 flutter 를 업그레이드 했습니다. 그리고 Android Studio 에서 자동완성이 안되길래, flutter doctor 를 실행했더니, 아래와 같은 결과가 출력되었습니다.

Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.13.3, on macOS 13.2.1 22D68 darwin-x64, locale ko)
    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/3.1.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/0000/development/flutter. Consider adding /Users/0000/development/flutter/bin to the front of your path.
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.81.0)
[✓] Connected device (2 available)

해결방법

Dart 경로 관련 이슈

결론먼저 말씀드리면, 아래 명령어 실행 + Android SDK Command Line Tools 를 설치합니다.

brew uninstall dart

그러면 일단, flutter doctor 에서 출력되는 첫 번째 이슈인

! Warning: `dart` on your path resolves to 

이것은 해결됩니다.

Android toolChain 관련 이슈

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

이 이슈는 이곳에서 해결합니다.
Preference > Languages & Frameworks > Android SDK > SDK Tools

이곳에서 Android SDK Command-line Tools 체크하고 Apply 버튼이나 ok 버튼을 클릭하면, 다운로드화면이 출력될겁니다.

이후 다시 flutter doctor로 이슈가 해결되었는지 확인합니다.

정상적으로 해결된 이후에, cmd + space 클릭하면, 안되실수도 있습니다.

마지막으로, Xcode 에 Clean build 가 있다면, Android Studio 에 있는 Invalid cache

전 가능하면, 클릭 이후에 모든 설정을 체크해서 cache 를 제거합니다.

그리고 다시 시도하면, 저는 성공했습니다.
혹시 이후에도 지속적으로 실패한다면, Dart / Flutter SDK 설치 위치를 확인해보시고, VScode 에서는 정상적으로 되는지 확인해보세요. VSCode 에서 정상적으로 된다면, SDK 의 문제는 아닐겁니다.

참고자료

profile
iOS & Flutter

0개의 댓글