Flutter can't find ANDROID_HOME path
148
I was later able to fix this; I found that the problem can be fixed by running;
sdkmanager "platform-tools" "platforms;android-28" "build-tools;28.0.3"
Once this is done, open bashrc set the ANDROID_HOME to:
ANDROID_HOME = /usr/lib/android-sdk
then run source ~/.bashrc
to update bash. This should fix the problem.
Author by
Paschal
Updated on December 23, 2022Comments
-
Paschal 11 months
I am having troubles getting flutter to detect the ANDROID_HOME in ~/.bashrc
I get this error when I
flutter doctor
:Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 1.20.2, on Linux, locale en_US.UTF-8) [✗] Android toolchain - develop for Android devices ✗ ANDROID_HOME = /usr/lib/android-sdk/cmdline-tools/tools/bin but Android SDK not found at this location. [!] Android Studio (not installed)
I cd into ANDROID_HOME using
ls $ANDROID_HOME
, thenls -la
gave me:i992@paschal:/usr/lib/android-sdk/cmdline-tools/tools/bin$ ls -la total 48 drwxr-xr-x 2 root root 4096 Aug 24 14:56 . drwxr-xr-x 4 root root 4096 Aug 24 14:55 .. -rwxr-xr-x 1 root root 5322 Aug 24 14:55 apkanalyzer -rwxr-xr-x 1 root root 5313 Aug 24 14:55 avdmanager -rwxr-xr-x 1 root root 5281 Aug 24 14:55 lint -rwxr-xr-x 1 root root 5310 Aug 24 14:55 screenshot2 -rwxr-xr-x 1 root root 5320 Aug 24 14:55 sdkmanager
This confirms that sdkmanager is present. Any idea why flutter isn't picking it up?
~/.bashrc path conf:
export ANDROID_HOME=/usr/lib/android-sdk/cmdline-tools/tools/bin