i have installed android studio by unzipping the zip file from the official site and running sudo ./studio.sh
.
so, it was installed in /root directory.
but when i installed flutter as recommended in the official site, it said that android sdk is not found along with android studio.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.6.0, on Linux, locale en_US.UTF-8)
[✗] 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.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
[✗] Android Studio (not installed)
[✓] VS Code (version 1.26.1)
[!] Connected devices
! No devices available
! Doctor found issues in 3 categories.
after that, i tried googling for some answers and i did found'em which were all like this:
adding $ANDROID_HOME to home/.bashrc or home/.bashrc_profile or in my case, to home/.zshrc, following the execution of the command source /.the_file
BUT, that didn't work, why !!? i don't know!
here is my configuration for environment var
export PATH=/home/joe-inz/Flutter/flutterSDK/flutter/bin:$PATH
export ANDROID_SDK_ROOT=/root/Android/Sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools/:$ANDROID_SDK_ROOT
to confirm:
/home/joe-inz/Flutter/flutterSDK/flutter/bin /home/joe-inz/Flutter/flutterSDK/flutter/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin /usr/lib/jvm/java-8-oracle/bin /usr/lib/jvm/java-8-oracle/db/bin /usr/lib/jvm/java-8-oracle/jre/bin /root/Android/Sdk/tools /root/Android/Sdk/platform-tools/ /root/Android/Sdk /home/joe-inz/.config/composer/vendor/bin /home/joe-inz/.config/composer/vendor/bin /root/Android/Sdk/tools /root/Android/Sdk/platform-tools/ /root/Android/Sdk /home/joe-inz/.config/composer/vendor/bin
ps: the reason for $ANDROID_SDK_ROOT because I read is some issue in GitHub that $ANDROID_HOME is deprecated !!!!, although with $ANDROID_HOME it didn't work.
Please don't mark it as duplicate because I've tried the previous solutions an none of them worked!
Thanks in advanced.
/root
it should be in/home/$USER
or/opt
please move it to/home/$USER
(best location IMO) and change the ownership to yours...sudo cp -R /root/android-studio ~/ && sudo chown -R $USER:$USER ~/android-studio
, NOTE: Make sure the name of the android studio folder is correct as it is in your system, I assume it is calledandroid-studio
as in mine