Flutter Issue

flutter doctor

1
flutter.bat doctor --verbose

cmdline-tools component is missing

message
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
D:\app\src\flutter\flutter\bin\flutter.bat doctor --verbose

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\robertkao\AppData\Local\Android\sdk
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.

[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components


! Doctor found issues in 2 categories.
Process finished with exit code 0
Install Android SDK Command-line Tools(latest)

Android licenses is taking an unexpectedly

message
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
D:\>flutter.bat doctor --verbose

Checking Android licenses is taking an unexpectedly long time...[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\robertkao\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: D:\app\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components

! Doctor found issues in 2 categories.
fix Android licenses
1
2
# all response press 'y'
flutter doctor --android-licenses

Visual Studio not installed

message
1
2
3
4
5
6
7
8
D:\>flutter.bat doctor --verbose

[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components

! Doctor found issues in 1 category.
install Visual Studio’s “Desktop development with C++”

C: 131G to 120G (2022.08.16)

Emulator LockDown

set boot option to cold boot

exist Android Studio

deleted emulator .lock file

start Android Studio, run emulator

project issue

Your project requires a higher compileSdkVersion

1
2
3
4
5
6
7
8
┌─ Flutter Fix ──────────────────────────────────────────────────┐
│ [!] Your project requires a higher compileSdkVersion. │
│ Fix this issue by bumping the compileSdkVersion in │
│ D:\work\run\flutter\mi_card_flutter2\android\app\build.gradle: │
│ android { │
│ compileSdkVersion 31 │
│ } │
└────────────────────────────────────────────────────────────────┘
fix build.gradle (change 29 to 31)
1
2
3
4
android {
compileSdkVersion 31

}