Flutter 문서 제공 사이트 - https://flutter-ko.dev/docs 아름답게 한국어로 번역되어있다.
Flutter는 기본적으로 웹 Document를 제공해줘서 설치하는 데에는 크게 문제가 될 것 같지는 않았다.
게다가 한글 번역이 된다니 너무나 놀라웠다. 하지만 언제나처럼 예상은 빗나가는 법이 었다.
(- 모든 문서가 번역되어 있는건 아니었습니다. :D)
문제 발생
flutter doctor -v
해당 명령어를 검색하면 환경 구축시 문제되는 부분을 조금 더 자세하게 볼 수 있다.
hyeokchani-MacBook-Pro: ~ hyeokchani$ flutter doctor -v
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B50 darwin-x64, locale en-KR)
• Flutter version 1.22.5 at /Users/hyeokchani/flutter
• Framework revision 7891006299 (6 weeks ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/hyeokchani/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/AndroidStudio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
•CocoaPods version 1.10.1
// 여기까지는 이상없이 잘 할 수 있었다.
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1[!] Connected device
! No devices available! Doctor found issues in 2 categories.
다음과 같이 Flutter와 Dart 플러그인을 Android Studio에서 인식을 하지 못하는 것이 었다.
해결
hyeokchani-MacBook-Pro:~ hyeokchani$ flutter upgrade
Flutter is already up to date on channel stable
Flutter 1.22.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7891006299 (6 weeks ago) • 2020-12-10 11:54:40 -0800
Engine • revision ae90085a84
Tools • Dart 2.10.4hyeokchani-MacBook-Pro:~ hyeokchani$ flutter channel beta
Switching to flutter channel 'beta'...
git: Switched to a new branch 'beta'
git: Branch 'beta' set up to track remote branch 'beta' from 'origin'.
Successfully switched to flutter channel 'beta'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
아마 오류가 있는 git branch를 switch 해줌으로써 새롭게 데이터를 받아올 수 있는 환경을 만들어준 것 같다.
그러면 다음과 같이
hyeokchani-MacBook-Pro:~ hyeokchani$ flutter doctor -v
Downloading Dart SDK from Flutter engine 7a8f8ca02c276dce02f8dd42a44e776ac03fa9bc...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 173M 100 173M 0 0 5212k 0 0:00:34 0:00:34 --:--:-- 8686k
Building flutter tool...
Downloading package sky_engine... 705ms
Downloading flutter_patched_sdk tools... 1,971ms
Downloading flutter_patched_sdk_product tools... 1,669ms
Downloading darwin-x64 tools... 6.7s
Downloading darwin-x64/font-subset tools... 622ms
// 새롭게 다운로드를 하고,
[✓] Flutter (Channel beta, 1.25.0-8.3.pre, on macOS 11.0.1 20B50 darwin-x64, locale en-KR)
• Flutter version 1.25.0-8.3.pre at /Users/hyeokchani/flutter
• Framework revision 5d36f2e7f5 (8 days ago), 2021-01-14 15:57:49 -0800
• Engine revision 7a8f8ca02c
• Dart version 2.12.0 (build 2.12.0-133.7.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/hyeokchani/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/AndroidStudio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
해당되던 문제도 해결된 것을 볼 수 있었다.
이후 beta channel로 업그레이드 해주면 된다.
hyeokchani-MacBook-Pro:~ hyeokchani$ flutter upgrade
Flutter is already up to date on channel beta
Flutter 1.25.0-8.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 5d36f2e7f5 (8 days ago) • 2021-01-14 15:57:49 -0800
Engine • revision 7a8f8ca02c
Tools • Dart 2.12.0 (build 2.12.0-133.7.beta)
이후에는 Android Studio에서도 환경 변수(Path)가 잘 연결되었는지 확인해본다.
마지막은 switch 했던 branch를 다시 복구하는 과정이다.
hyeokchani-MacBook-Pro:~ hyeokchani$ flutter channel
Flutter channels:
master
dev
* beta
stable
hyeokchani-MacBook-Pro:~ hyeokchani$ flutter channel stable
Switching to flutter channel 'stable'...
git: Switched to branch 'stable'
git: Your branch is up to date with 'origin/stable'.
Successfully switched to flutter channel 'stable'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
해당 문제를 해결하기 위해서 비슷한 오류가 있는 블로그를 찾았습니다.
그 블로그를 통해 많은 도움을 받을 수 있었고 비록 운영체제는 달랐지만 같은 명령어로 호환이 되게 만들었다는 것에 flutter를 보고 놀라웠습니다.
해결 방법 참조.
blog.naver.com/q7p/222167463989
다시한번 도움을 주신 블로거분 감사합니다.