I'm on Ubuntu 20.04 LTE
My Android SDK Location (shown in Android studio) is /home/myuser/Android/Sdk
The error goes as follows:
✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
What I did to try to fix it:
- Fresh installs of both Flutter (via snap) and Android studio (via apt, because when I install it also via snap, Flutter can't find even Android studio then).
- Set configs:
flutter config --android-sdk="/home/myuser/Android/Sdk"
flutter config --android-studio-dir="/opt/android-studio-2021.1.1/android-studio"
- Set paths in .bashrc:
export ANDROID_HOME=$HOME/Android/Sdk/
export PATH=$PATH:$ANDROID_HOME/tools/
export PATH=$PATH:$ANDROID_HOME/platform-tools/
- In Android studio, I installed:
- Dart and Flutter plugins.
- SDK Platforms: 9.0(Pie), 10.0(Q), 11.0(R), 12.0(S), Android API 32
- SDK Tools:
- Android SDK Build-Tools 33-rc2
- Android SDK Command-line Tools (latest)
- Android Emulator 31.2.9
- Android SDK PLatform-Tools 33.0.1
- Trying to do
flutter doctor --android-licenses
doesn't do anything as it can't find Android SDK.
And I also can't run flutter doctor
without adding sudo
, because it stops after the first result and then runs for infinity.