[Flutter] 프로젝트 준비
1. vs code 에서 샘플 프로젝트 생성
- 전제 : extension이 모두 설치되어 있어야함
- ctrl + shift + p : flutter new project 입력 > application > hello_flutter 입력
- 다음과 같이 파일 수정
- vscode dart 세팅
ctrl + shift + p : dart recommend 입력 > Dart: Use Recommended Settings 선택
- emulatior 실행
ctrl + shift + p : launch emulator 입력 > Flutter: launch emulator 선택
** 다음과 같이 용량 이슈로 실행이 안되는 상황...
C드라이브 용량으로 인하여 emulator 실행이 안되는 이슈가 있었는데 아래와 같은 방법으로 해결함
1. .android/avd 하위의 .avd 폴더를 E드라이브로 옮김(E:\flutter\Pixel_3a_API_34.avd)
2. .android/avd 하위의 .avd 폴더를 지우고, 해당 ini 파일의 path를 E드라이브의 path로 지정해줌
3. vscode 에서 emulator 실행시 잘되는 것을 확인할 수 있다.
* 이런 이슈도 있음 ( 에뮬레이터 실행 시 , 아래 에러 로그 )
아래 파일을 찾아서 실행 및 설치 (sdk manager 에서 설치가 되어있어야함)
[에뮬레이터 실행 시 vs code 상에 에러 로그]
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file 'D:\flutter\hello_flutter\android\settings.gradle' (C:\Users\my\.gradle\caches\6.7\scripts\1fnwrr8g4rohfp291nvlxj5qe).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 28s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
-> 아래 방법으로 해결
1) gradle-wrapper.properties 파일 수정 to. 7.6.-all
( * distributionUrl 속성이 gradle 버전 이라고 보면 됨 )
2) build.gralde 버전 수정 to. 7.0.0
3) openJDK 15 설치 (https://jdk.java.net/archive/)