0

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.

3
  • You do not install studio in /root it should be in /home/$USER or /opt please move it to /home/$USER (best location IMO) and change the ownership to yours... Aug 30, 2018 at 19:24
  • it was installed by default in /root ... can you tell me how to change location ?
    – joe_inz
    Aug 30, 2018 at 19:26
  • do 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 called android-studio as in mine Aug 30, 2018 at 19:29

2 Answers 2

0

This is the official installation guide:

Linux

To install Android Studio on Linux, proceed as follows:

  1. Unpack the .zip file you downloaded to an appropriate location for your applications, such as within /usr/local/ for your user profile, or /opt/ for shared users.
  2. To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh.
  3. Select whether you want to import previous Android Studio settings or not, then click OK.
  4. The Android Studio Setup Wizard guides you though the rest of the setup, which includes downloading Android SDK components that are required for development.

Now move the folders to your /home/$USER directory as I feel this gives you less trouble (IMO) and then delete it:

sudo cp -R /root/android-studio ~/ && sudo chown -R $USER:$USER ~/android-studio && sudo rm -rf /root/android-studio

NOTE: Make sure the name of the android studio folder is correct as it is in your system, I assume it is called android-studio as in mine

1
  • 1
    thank you for your help, I've fixed it by running the installer again from the created entry and installing android studio in /home directory.
    – joe_inz
    Aug 31, 2018 at 10:54
0

So the answer to my problem (other parties could find the Android SDK) is to make sure Android Studio is installed in home directory or where other parties could find it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .