Android SDKが認識されないError[solved]
Android SDKが認識されないError
Flutterをversion3.19.0にupdateした
flutter doctor
**└****─(****12:43:25** on main ✖ ✹ ✭**)****──>** flutter doctor **─****─(****Sat,Feb17****)─****┘**
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.0, on macOS 12.6.7 21G651 darwin-x64, locale
en-AU)
[✗] Android toolchain - develop for Android devices
**✗** **ANDROID_HOME = ~/Library/Android/sdk**
**but Android SDK not found at this location.**
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.86.1)
[✓] Connected device (2 available)
[✓] Network resources
! Doctor found issues in 1 category.
SDKは最新をdownload済みなのに反映されていない。 adb commandにすでに環境変数ANDROID_HOMEを設定しているからかも?
//.zshrc
# adb command for android-studio
export ANDROID_HOME="~/Library/Android/sdk"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools
flutter config
であらためて~/Library/Android/sdk
への直通PATHを設定してあげる
flutter config --android-sdk ~/Library/Android/sdk
Setting "android-sdk" value to "/Users/$HOME/Library/Android/sdk".
You may need to restart any open editors for them to read new settings.
Solved
flutter doctor **─****─(****Sat,Feb17****)─****┘**
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.0, on macOS 12.6.7 21G651 darwin-x64, locale
en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.86.1)
[✓] Connected device (2 available)
[✓] Network resources
• No issues found!