Flutter 다운로드
공식 홈페이지 접속하면 간단하게 다운로드 가능하다.
사이트 – https://flutter-ko.dev/docs/get-started/install/macos
다운로드 위치는 취향인데,
나는 사용자 폴더에 다운로드 했다.
사용자 폴더를 가는 쉬운 방법은 파인더를 열고
shift-command-C 를 누르면
상위 폴더로 가서 설치할 곳을 정하면 된다.
Flutter PATH 설정
Flutter 명령어를 실행하기 위해 경로를 설정해야 한다.
export PATH="$PATH:`pwd`/flutter/bin"
pwd 명령어를 이용하면 현재 경로를 알 수 있다.
‘pwd’ 에 /Users/hongseobshin/Dev/SDK/flutter 를 넣어주면 된다.
bash 파일에 PATH를 저장하면 편하게 계속 사용할 수 있다.
vi ~/.bash_profile
에서 아래 PATH 를 입력한다.
export PATH=$PATH:$HOME/Dev/SDKs/flutter/bin
Flutter 환경 설치
flutter doctor
를 실행하면 간단하게 환경을 점검할 수 있다.
toolchain, xcode, android studio, device 항목에 문제가 있다고 한다.
하나씩 고쳐가면 된다.
-
toolchain
문제를 보면,
✗ Android licenses not accepted. To resolve this, run: flutter doctor –android-licenses
라이센스를 못 얻었다고 한다.
flutter doctor --android-licenses
실행하면 해결할 수 있다고 한다.
계속 y 를 입력해서 각종 라이센스를 accept 하면 된다.
flutter doctor
를 실행해보면,
문제가 잘 해결 되었다.
-
Android studio
2가지 문제가 있다고 한다.
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
android studio에 flutter plugin 하고 Dart plugin이 설치 안됐다고 한다.
plugin 을 설치해보자
android studio 실행하면,
Plugins 메뉴에서 플러그인을 설치할 수 있다.
검색하면 바로 찾을 수 있는데
설치 중에 Dart 에 종속성이 있다고 하면서 창이 뜬다.
Dart도 설치해야되기 때문에 yes 를 눌러서 같이 설치하자.
flutter doctor
를 실행해보면,
Android Studio 문제가 해결되었다.
-
Xcode
Xcode 도 보니 2가지 문제가 있다.
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select –switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side’s plugin code that responds to your plugin usage on the Dart
side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
먼저 xcode를 설치한다.
설치는 간단하게 appstore 에서 검색하면 나온다.
그리고 설치하면 아래 명령어를 실행하라고 한다.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
뭔가 설치되는 거 같다.
설치가 다 되었다.
하라는 대로 다 했는데 아직도 xcode에 대한 문제가 있다면,
xcode 한번 실행하고
Xcode를 한 번 열어 확인을 선택하거나 커멘드라인에서
sudo xcodebuild -license
를 입력하여 Xcode 라이센스 계약이 서명되었는지 확인하면 된다.
스페이스 쭉 누르면 끝난다.
2번째 문제를 보자.
✗ CocoaPods not installed.
CocoaPods가 설치 안되었다고 하니
CocoaPods 설치해보자
설치는 간단하게 명령어 한줄이면 된다.
sudo gem install cocoapods
flutter doctor
를 실행해보면,이제 준비가 끝났다.
Leave A Comment