How to set Android Home in Ubuntu when the path is in the root folder
In my personal setup and starting from a fresh install, Android Studio place the two directories on the /root/Android... and the over on the /home/{user}/.. directory. You should set up the Android_HOME PATH on the second one.
export ANDROID_HOME=/home/{user}/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools
Be careful with the correct locations, sometimes I might change according to the current installation directories.
Ubuntu / Elementary OS cannot set ANDROID_HOME
You need to add the variable in your PATH as well. The aim is for your PATH variable to contain the complete folder path, in which the file 'android' is present.
export ANDROID_HOME=~/android-sdk/Sdk/tools
export PATH=$ANDROID_HOME:$PATH
Don't forget to source your bashrc after adding these lines
source ~/.bashrc
Again, the file 'android' should be present in the tools folder.
Failed to find 'ANDROID_HOME' environment variable
You may want to confirm that your development environment has been set correctly.
Quoting from spring.io:
Set up the Android development environment
Before you can build Android applications, you must install the
Android SDK. Installing the Android SDK also installs the AVD Manager,
a graphical user interface for creating and managing Android Virtual
Devices (AVDs).
From the Android web site, download the
correct version of the Android SDK for your operating system.Unzip the archive to a location of your choosing. For example, on Linux or Mac, you can place it in the root of your user directory. See
the Android
Developers
web site for additional installation details.Configure the
ANDROID_HOME
environment variable based on the location of the Android SDK. Additionally, consider adding
ANDROID_HOME/tools
, andANDROID_HOME/platform-tools
to your PATH.
Mac OS X
export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Linux
export ANDROID_HOME=/<installation location>/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Windows
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
The Android SDK download does not include specific Android platforms.
To run the code in this guide, you need to download and install the
latest SDK platform. You do this by using the Android SDK and AVD
Manager that you installed in the previous section.
Open the Android SDK Manager window:
android
Note: If this command does not open the Android SDK Manager,
then your path is not configured correctly.Select the Tools checkbox.
Select the checkbox for the latest Android SDK.
From the Extras folder, select the checkbox for the Android Support Library.
Click the Install packages... button to complete the download and installation.
Note: You may want to install all the available updates, but be
aware it will take longer, as each API level is a large download.
Related Topics
How to Make Android Apps Which Support Both 32-Bit and 64-Bit Architecture
Replace Default Android Maps API V2 Change Mylocation Icon
Locationlistener of Network_Provider Is Enabled But , Onlocationchanged Is Never Called
System.Exit(0) Doesnt Close All My Activities
How to Fix Error: No Signature of Method: Build_Ap86Oam3Dut3Pxce3X49Rdtma.Android()
Java.Lang.Nullpointerexception (No Error Message)
Change Actionbar Color Programmatically More Than Once
How to Get Name of Wifi-Network Out of Android Using Android API
Cancel Notification on Remove Application from Multitask Panel
Set Selected Item in Android Bottomnavigationview
Android: Radiogroup - How to Configure the Event Listener
Firebase @Propertyname Doesn't Work
Run Code When Android App Is Closed/Sent to Background
Flutter Projects & Android X Migration Issues
Get the Latest Fragment in Backstack