I have installed Android Studio on my MacBook Air (OS Version 10.11 El Capitan) and have successfully written a small "hello, world" app and installed on device (Nexus 7) and ran on AVD. All I want to do now is be able to build the app and install it on device from the command line as opposed to Android Studio. I'm following the directions here:
http://developer.android.com/training/basics/firstapp/running-app.html
and the relevant line is:
Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable, then execute:
The problem is I can't find the Android SDK on my machine! I assume it's there because otherwise the program wouldn't compile and run through Android Studio? Perhaps that's a bad assumption? I'm new to Macs (I'm used to Windows) so I don't know the best way to search for the Android SDK. So my questions:
How do I find Android SDK on my machine? Or prove to myself it's not there?
If it's not there how do I install it?
How do I change PATH to include Android SDK?
1. How to find it
Open Android studio, go to Android Studio > Preferences
Search for sdk
Something similar to this (this is a Windows box as you can see) will show
You can see the location there – most of the time it is:
/Users/<name>/Library/Android/sdk
2. How to install it, if not there
Go to Android standalone SDK download page
Download the zip file for macOS
Extract it to a directory
3. How to add it to the path
Open your Terminal edit your ~/.bash_profile file in nano by typing:
nano ~/.bash_profile
If you use Zsh, edit ~/.zshrc instead.
Go to the end of the file and add the directory path to your $PATH:
export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
Save it by pressing Ctrl+X
Restart the Terminal
To see if it is working or not, type in the name of any file or binary which are inside the directories that you've added (e.g. adb) and verify it is opened/executed
If you don't want to open Android Studio just to modify your path...
They live here with a default installation:
${HOME}/Library/Android/sdk/tools
${HOME}/Library/Android/sdk/platform-tools
Here's what you want to add to your .bashwhatever
export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
Find the Android SDK location
Android Studio
> Preferences
> Appearance & Behaviour
> System Settings
> Android SDK
> Android SDK Location
Create a .bash_profile file for your environment variables
Open the Terminal app
Go to your home directory via cd ~
Create the file with touch .bash_profile
Add the PATH variable to your .bash_profile
Open the file via open .bash_profile
Add export PATH=$PATH: [your SDK location] /platform-tools to the file and hit ⌘s to save it. By default it's:
export PATH=$PATH:/Users/yourUserName/Library/Android/sdk/platform-tools
Go back to your Terminal App and load the variable with source ~/.bash_profile
How do I find Android SDK on my machine? Or prove to myself it's not there?
When you install Android studio, it allows you to choose if you want to download SDK or not
If it's not there how do I install it?
you can get SDK from here http://developer.android.com/sdk/index.html
How do I change PATH to include Android SDK?
in Android Studio click in File >> Settings
If Android Studio shows you the path /Users/<name>/Library/Android/sdk
but you can not find it in your folder, just right-click and select "Show View Option". There you will be able to select "Show Library Folder"; select it and you can access the SDK.
The default path of Android SDK is /Users/<username>/Library/Android/sdk, you can refer to this post.
add this to your .bash_profile to add the environment variable
export PATH="/Users/<username>/Library/Android/sdk/tools:/Users/<username>/Library/Android/sdk/build-tools:${PATH}"
Then save the file.
load it
source ./.bash_profile
AndroidStudioFrontScreenI simply double clicked the Android dmg install file that I saved on the hard drive and when the initial screen came up I dragged the icon for Android Studio into the Applications folder, now I know where it is!!! Also when you run it, be sure to right click the Android Studio while on the Dock and select "Options" -> "Keep on Dock".
Everything else works.
Dr. Roger Webster
For Visual Studio for Mac users (e.g. who installed Android SDK together with VS):
open Visual Studio for Mac
select from menu: Tools -> SDK Manager -> Select 3rd tab: 'Localizations' in dialog
You can find JDK, Android NDK and Android SDK localizations there (if installed and selected). If no Android SDK path found, you may try to find it using Android Studio (if it is installed)
In my case, I had to create local.properties file with sdk.dir=PATH_TO_ANDROID_SDK in my machine. It seems that, it's regarding the android sdk path setup. Hence, it could also be set in ANDROID_HOME env. variable too.
I found it here:
/Users//Library/Android/sdk
and Platform-tools is available as well
Related
After typing cordova run android in terminal, I'm getting this error:
Waiting for emulator to start...
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/Users/username/Library/Android/sdk]!
This happens after exporting:
export ANDROID_SDK_ROOT='/Users/username/Library/Android/sdk'
Before exporting I got:
Waiting for emulator to start...
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
Any ideas where I'm going wrong? I'm sure this is the sdk root so why am I getting broken avd system path?
There are may be several different problems when you move your AVD or SDK to another directory, or replace an old SDK with a new one, or somehow get the SDK corrupted.
Below I'll describe all the possible problems I know, and will give you several ways to solve them.
Of course I assume that you have any AVD created, and it is located in C:\Users\<user_name>\.android\avd (Windows) or ~/.android/avd (Linux/MacOS).
If you moved .android to another place then set the ANDROID_SDK_HOME environment variable to the path of the parent dir containing your .android and make sure the AVD Manager successfully found your Virtual Device.
Also check paths in <user_home>/.android/avd/<avd_name>.ini
Incomplete/corrupted SDK stucture
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value
These 2 errors happen if the emulator cannot find the SDK, or the SDK is broken.
So, first of all I recommend to remove the ANDROID_SDK_ROOT variable at all. It's only needed when the emulator is located outside of the SDK directory. But in general, your emulator stays inside the SDK dir. And in this case it must detect the SDK location automatically. If it doesn't, then your SDK probably has wrong filetree. Please do the following:
Check that the SDK directory has at least these 4 directories: emulator, platforms, platform-tools, system-images. It is very important! These directories must be present. If some of them don't exist, then just create empty dirs.
Go to <user_home>/.android/avd/<avd_name> and open config.ini. Find the image.sysdir.1 property. It points at the directory, inside the SDK directory, that contains the actual system image. Make sure that this directory exists and contains files like build.prop, system.img, etc. If it doesn't, then you have to open the SDK Manager and download system images your AVD requires (see below).
If everything's set up properly, when these errors about ANDROID_SDK_ROOT must be gone. If they're not, then now you may try to set up ANDROID_SDK_ROOT variable.
Required packages and HAXM are not installed
The next problem you may face is that the emulator starts to launch, but hangs up or quits immediatelly. That probably means that you don't have all the required packages installed.
Another possible error is:
Could not automatically detect an ADB binary. Some emulator functionality will not work until a custom path to ADB is added in the extended settings page.
So, to successfully launch any AVD you must be sure that at least these packages are installed:
emulator (Android Emulator)
platform-tools (Android SDK Platform-Tools)
tools (Android SDK Tools)
And as I mentioned earlier you must install system images your AVD is using, for example system-images;android-25;google_apis;x86
Note that the most recent versions on SDK don't have a standalone SDK Manager.exe. Instead of it you have either to use Android Studio, or tools\bin\sdkmanager.bat (Linux/MacOS probably have sh files).
To list all available packages use sdkmanager --list or sdkmanager --list --verbose
To install packages use sdkmanager <package1> <package2> ...
Also I recommend to install HAXM on your system manually.
Qcow2-files refer to incorrect/nonexistent base-images
The last problem I'll mention happens when you're trying to move AVD or SDK from one computer or directory to another. In this case you may get such error:
qemu-system-i386.exe: -drive if=none,overlap-check=none,cache=unsafe,index=0,id=system,file=C:\Users\<old_user_name>\.android\avd\<avd_name>.
avd\system.img.qcow2,read-only: Could not open backing file: Could not open '<old_sdk_dir>\system-images\android-22\google_apis\x86\system.img': Invalid argument
There are 2 ways to fix it:
If you don't care about the data the AVD contains, just delete all the qcow2 files from the AVD directory (e.g. from <user_home>/.android/avd/<avd_name>). In this case you will get a clean version of Android, like after a hard reset.
If the data on the emulator is important to you, then open all qcow2 files one by one using any HEX editor (I prefer HxD), find the path of a base img file, and change it to the correct one in the Overwrite mode (to preserve the file size). Then select the path and get its length in hex (e.g. 2F). 2F represents the ASCII slash /. Put it into position 13:
PS: Not sure, but there are probably some utilites like qemu-img allowing to set different base image. Well, to me it's easier to manually edit the binary.
Now you'll probably be able to successfully launch your Android Virtual Device. I hope so :)
On Mac:
I had installed android-sdk using brew as well as Android Studio. Somehow, having 2 installations was causing this problem. When I uninstalled my brew installation of the sdk using brew cask uninstall android-sdk and added the following vars to my env. It worked.
export ANDROID_HOME=/Users/<Username>/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
This will solve your problem in macOS:
pico ~/.bash_profile
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export ANDROID_SDK_HOME=/Users/$USER/Library/Android/sdk
export ANDROID_AVD_HOME=/Users/$USER/.android/avd
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_AVD_HOME
source ~/.bash_profile
It means that your path to tools is incorrect. This is what it looks like on a mac using brew. Mind the version.
export ANDROID_SDK_ROOT='/usr/local/Cellar/android-sdk/24.4.1_1'
In your case it looks like you should run this:
export ANDROID_SDK_ROOT='/Users/username/Library/Android/sdk'
Removing the Error While Using Homebrew's Android SDK as the Default SDK
As #EFreak did I installed the android-sdk with homebrew (a package manager for Macs). I needed to do the below to fix the error, because I was following the nativescript tutorials and ran into the error. If you like me intend to use the brew version over the android-sdk version use this answer (this will allow you to use nativescripts tns run android api), and if you want the android studio default android-sdk follow #EFreak's answer.
Configuring Android Studio to use the Homebrew's Android SDK's
Basically you just need to change your Android SDK location in Android studio. First open a project in android studio. Then open the SDK Manager by clicking this button.
Next when the default preferences for the android SDK manager comes up you need to click edit next to the android SDK location.
Finding the Location of Homebrew's Android SDK
Next you need to actually update the sdk location on the sdk components setup screen my brew android-sdk was located here /usr/local/share/android-sdk. You can find where yours is installed by running brew cask info android-sdk then near the bottom of the output it should say:
You can control android sdk packages via the sdkmanager command.
You may want to add to your profile:
'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"'
The value of the exported ANDROID_SDK_ROOT variable (which here is /usr/local/share/android-sdk) is home-brew's location of the android sdk.
Then you need to click the Android SDK Location button (labeled as 1 in the picture) and paste in Homebrew's Android SDK location.
Then just finish up the wizard by installing whatever packages. I needed to delete and recreate my device emulators at this step, but it seemed to work great after that.
Setting the Android SDK Environment Variables to Point to Homebrew's Android SDK
Also you may want to make sure if you are going the Homebrew route that your profile settings script has the ANDROID_HOME and ANDROID_SDK_ROOT environment variables set to your Homebrew location of the android sdk otherwise the above won't work yet. This can get changed from the Homebrew location if you installed Homebrew before installing Android Studio as pointed out in this answer by #Jamie Armour. You can check the environment variables for the android sdk are set correctly by running echo $ANDROID_HOME and echo $ANDROID_SDK_ROOT and verifying that they both show the Homebrew location of the android sdk.
If you need to change the ANDROID_HOME and ANDROID_SDK_ROOT values you can do this in your profile settings in your Mac which would likely be in something like ~/.bash_profile, "~/.bashrc", or "~/.profile" and defined like so:
export ANDROID_HOME="/usr/local/share/android-sdk"
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
You need to change the values of both the exports to the proper values of Homebrew's android SDK location then save the file. To verify that the right values have been written you should first either close and open your terminal which should rerun the file and reset the environment variables or you can source the file by running source <profile file name> where is the profile file you edited and saved. You then can rerun echo $ANDROID_HOME and echo $ANDROID_SDK_ROOT to verify that they have the Homebrew android sdk location.
I had same problem in my Windows10,
Isolved my problem by following the steps below.
open Android Studio
- Tools
- SDK Manager
- copy Android SDK Location
Android SDK Location
set system environment variable
ANDROID_HOME and ANDROID_SDK_ROOT
system environment variable
I had the same issue after emulator update. Problem was resolved after adding variable ANDROID_AVD_HOME
Important: Non-ASCII characters cannot be used in the path.
Finally reinstall virtual devices or manually override device path in Configuration settings.ini file which contains old path with non-ascii characters.
C:\Users\<user_name>\.android\avd\<avd_name>
Platfoms directory was missing in /usr/local/share/android-sdk.
I created an empty directory named platforms that fixed the issue.
In my case it was broken because ANDROID_HOME and ANDROID_SDK_ROOT were different, so once I set ANDROID_HOME to be the same as ANDROID_SDK_ROOT then it started working.
I ran Android Studio on Windows 10, set ANDROID_HOME and ANDROID_SDK_ROOT on Environment Variables, and still got the error.
Turns out, I forgot to download the device.
After downloading the "Missing system image", everything works fine.
Oleg Cherrs answer led me to a solution. As he mentioned
Go to /.android/avd/ and open config.ini. Find the >image.sysdir.1 property. It points at the directory inside SDK containing system >images. Make sure that this directory exists and contains files like build.prop, >system.img, etc. If it doesn't, then you have to open the SDK Manager and >download system images your AVD requires (see below).
I found the corresponding emulator *.ini file in the avd directory.
There I modified the "image.sysdir.1" entry. I replaced the relative with an absolute path (append the ANDROID_SDK_ROOT in front). After that the emulator started from the command line as expected.
I'm in Windows 10 and the problem was that the avd's directory in my computer had non-ASCII characters in it.
Here's what to do:
Run cmd as administrator
Run the following command:
mklink /D C:\\.android C:\\Users\\-yourUsername-\\.android
(This will create a symbolic link between the path with non-ASCII characters and the new one)
In enviroment variables add ANDROID_AVD_HOME variable with value C:\\.android\avd.
A fix if your user contains non-ASCII characters
For people getting "PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT", the reason for this might be that your user in users contains non-ASCII characters.
Therefore both the SDK and .android folder with the AVD folder need to be moved to another folder.
Changing the SDK path:
Open Android Studio, go to configure, and choose the SDK Manager. Change the current Android SDK Location to e.g "C:\Android\Sdk" (Or somewhere else, just not in the user folder containing non-ASCII characters).
After this, add the following system variables:
ANDROID_SDK_ROOT C:\Android\Sdk
ANDROID_HOME C:\Android\Sdk
Changing the AVD path:
To change where the AVD folder is placed (Normally placed in "C:\Users\<user name>\.android\avd"), you need to change where the .android is placed. First close Android Studio, then add the system variable ANDROID_SDK_HOME with the path to the new place you want .android to be, e.g C:\Android_SDK_HOME as used in another example:
ANDROID_SDK_HOME C:\Android_SDK_HOME
After you added this, run Android Studio. Then close it again. Now a folder called .android should have appeared.
The next and last thing you need to do is to set the ANDROID_AVD_HOME system variable. In this case that will be in C:\Android_SDK_HOME\.android\avd
ANDROID_AVD_HOME C:\Android_SDK_HOME\.android\avd
I hope this resolves the problem for some. :)
ok i can run android from cordova, i changed ANDROID_HOME to,
export ANDROID_HOME=/usr/local/opt/android-sdk
You should add AVD Emulator.
Go to this location:
C:\Users\%username%\AppData\Local\Android\sdk\
start AVD Manager and in the second tab(Device Definitions) click on the button "createAVD".
All you need to do is install the platform for the desired emulator example for android 11
sdkmanager --install "platforms;android-30"
after you do this your emulator will start working just fine.
I had the same issue which after setting following path variables got vanished
Note AVD Home path is different from other three.
Check if the system image used by your AVD has been downloaded under $ANDROID_SDK_ROOT/system-images/
Just ran into that issue today and managed to solve it.
Emulator: [140735565005632]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at /Users/your_user_name/Library/Android/sdk/emulator/lib64/qt/lib
15:08 Emulator: Could not launch '/Users/your_user_name/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64': No such file or directory
The solution was pretty simple. Just install Android emulator through Android Studio => tools => Android => SDK manager => SDK tools => select Android Emulator => Apply
I'm using a MacBook Pro on macOS High Sierra, and I believe your machine has nothing to do with this issue. The emulator is not obviously installed when running the Android Studio installation manager for the first time, at least for me, with Android Studio 3.0.1
Also make sure you have your paths defined in your .bashrc or .zshrc like this:
export ANDROID_HOME=/Users/your_user_name/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
NativeScript
For anyone having trouble launching the android emulator via NativeScript, it's likely env vars ANDROID_HOME and ANDROID_SDK_ROOT have been overridden.
How I managed to create a problem for myself was by installing Android Studio to generate a different emulator. I did this after I had already installed the android sdk via home brew.
So if during the NativeScript installation, you selected to install android sdk via HomeBrew, NativeScript will set the above as follows:
ANDROID_HOME=/usr/local/share/android-sdk
ANDROID_SDK_ROOT=/usr/local/share/android-sdk
Subsequently installing Android Studio will override these values as:
ANDROID_HOME=/Users/[User]/Library/Android/sdk
ANDROID_SDK_ROOT=/Users/[User]/Library/Android/sdk
So naturally there is a conflict with Android studio and the NativeScript/Brew installation of the android sdk. Removing one or the other and/or verifying that the env variable contain the correct path should get your emulator to launch.
Delete early created devices.
Close Android studio.
Open: Control panel -> System & security -> System -> Advanced system settings ->
Environment variables.
Create New variable "ANDROID_SDK_HOME" and set
new path(in my case it was F:\Coding2019\Android\AVDdevices). Push 'ok'.
Open Android Studio.
Create new device. After creating in drop-down menu click "View Details" to see new path of new AVD.
中国的小伙伴注意!原因是avd目录不能包含中文
I tried all these method above, and I still get the error, and I wonder if it's because my avd directory contains chinese charactor. so I change The default avd directory by the following steps, and it worked.
1. create a folder whose path doesn't contain non-ascii character
2. copy or cut the default avd folder $HOME/.android below the folder you just created
3. add PATH ADNDROID_SDK_HOME, and the Android studio will find avd below $ADNDROID_SDK_HOME/.android/avd
finally it worked out! :>
In Windows 10 (without Android Studio) I solved the "PANIC: Broken AVD system path" by transferring '.android' folder from its default place in "C:\Users\Леон" into SDK folder. And change Environment as
ANDROID_SDK_ROOT=D:\Android\SDK
ANDROID_AVD_HOME=%ANDROID_SDK_ROOT%\.android\avd
ANDROID_EMULATOR_HOME=%ANDROID_SDK_ROOT%\.android
I suppose the problem might be either in non-ASCII symbols in my USER's path or they need to be "all together"
After quite some time trying other Googled "solutions", the only thing that worked for me, after setting the ANDROID_SDK_ROOT environment variable on Windows, and also adding and removing ANDROID_HOME and ANDROID_SDK_HOME variables, was Xerox23's answer - editing the AVD's config.ini to hardcode the value of ANDROID_SDK_ROOT into the image.sysdir.1 property.
This was using Android Studio 3.0.1 and emulator 26.1.4, launching the virtual device from the AVD Manager from within Android Studio.
For windows machine: After trying alot of set path, remove path and etc.
What finally work is to located the folder C:\Users\johndoe\.android and delete it. after that you can lunch your Android Studio, it will ask you to download and install a new AVD and it will override and create a fresh new folder and files. This solve the problem.
To solve this problem I had to install the package with the missing system image using SDK Manager.exe (in "C:\Program Files (x86)\Android\android-sdk"). I had noticed that the system image I needed ("android-23") was missing in "C:\Program Files (x86)\Android\android-sdk\system-images".
After running SDK Manager.exe and installing the appropriate packages I could run the emulator in Android Studio.
Here's the solution that worked for me:
https://www.embarcadero.com/starthere/xe5/mobdevsetup/android/en/creating_an_android_emulator.html
Follow below steps this should solve your problem
1.
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/bin
2.
Go to android studio preferences => Build, Execution, Deployment => Build Tools => Gradle => Android studio => Enable embedded Maven Repository should be selected.
3.
Go to android studio preferences => Appearance & Behavior => System Settings => Android SDK => Go to SDK Tools and select Android Emulator
The errors actually vary. It's helpful to run ./emulator with -verbose option, as it will show the actual errors.
I solved this problem by removing the file /usr/local/share/android-sdk,
because this file was created when I tried with homebrew .
export ANDROID_HOME=/Users/<username>/Library/Android/sdk
export ANDROID_SDK_ROOT=/Users/<username>/Library/Android/sdk
export ANDROID_AVD_HOME=/Users/<username>/.android/avd
that is enough ....
Open your android studio then focus on the toolbar.
Goto tools > SDK manager then
Appearance & Behavior > Systems Settings > Android SDK
Now in the tab copy the Android SDK Location from here
Android SDK Location
then goto your environment variables and then set the path along with these variables
ANDROID_HOME
ANDROID_SDK_ROOT
Environment Variables
I have installed Android Studio for the millionth time but when i go to C:\Program Files\Android\Android Studio , i can't find any folder named "SDK" , can't find it any where on the computer either.
Also, the SDK manager doesn't open, which i guess is a problem linked to the first one.
If you have downloaded the AS + SDK bundle:
Assuming the defaults were left unchanged, you will find the SDK in
C:\Users\%USERNAME%\AppData\Local\Android
If it is missing at this location, one of the following reasons apply: you have chosen a custom location, you missed to install the SDK at all, or (unlikely) they have changed the default install location.
Note #1: the AppData directory is hidden by default. If you have a standard Windows configuration, the C:\ path above should work "as is" (hit Win + R -> paste the path -> Enter).
Note #2: you will never find the SDK in the Android Studio directory unless you have explicitly put it in there. The reason is that those directories might be deleted after installing a newer version of Android Studio and you would have to re-install the SDK as well.
If you have retrieved the standalone SDK by some other means:
The SDK location may vary (from my experience), however (assuming the default configuration) you will most likely find it in C:\Program Files\Android or C:\Users\%USERNAME%
Tools > Android > SDK Manager > there you'll see the path to SDK
If you don't have it at C:\Users\%USERNAME%\AppData\Local\Android (this is where most people have it) than it is possible you don't have it installed. Go to Tools > Android > SDK Manager and then click on "Android SDK." On the top of the SDK Manager it will list the SDK Location. Click edit. If you don't have Android SDK installed, it will give you the option to install it in certain location. Install it, and Android Studio should work!
SDK folder by defalut is in C:\Users\<user-name>\AppData\Local\Android. And the AppData folder is hidden in windows. Enable show hidden files in folder option, and give a look inside that.
Make sure all the folders are visible.
click start>control panel>Appearance and Personalization>Show hidden files and folders then click "Show hidden files, folders and drives"
The file should be in C:\Users\Username\AppData\Local\Android as mentioned above. otherwise you can check by opening Android SDK Manager - top left under SDK path.
If SDK folder is present in system, one can find in C:\Users\%USERNAME%\AppData\Local\Android
If Android/SDK folder is not found
Once done with downloading and installing Android Studio, you need to launch studio.
On launching Android studio for the first time, we get option to download further more components, in that we have SDK.
On downloading components one can find SDK under Appdata (C:\Users\%USERNAME%\AppData\Local\Android)
I had to open Android studio and go through the wizard. Android studio will install the SDK for you.
If your are using android studio go to file >> project structure on the left pane press on SDK location . you will find the path where your sdk is located
When you install the android studio just by downloading from https://developer.android.com/studio/install.html sometimes sdk folder will not get appear in C:\Users\home\AppData\Local\Android Location..
But to set the android studio we need to set the path for android on this location.
So simply
1) start the android setup.
2) follow the instruction and android studio will automatically download the sdk folder by itself. (it will show the window like "Downloading Components").
After completing that installation check the above path again.
sdk folder will get appear now.
I faced the same issue. And I am able to resolve it by uninstalling the previous version I had, and removing the Android studio projects and reinstalling it.
And then go to Settings-> Android Studio -> Click on edit, to specify studio location, it will recognize the requask you if you would like to download sdk,
So I was trying to root one of my old phones and process required Android SDK. When I searched Android SDK, all i could do was download and install Android Studio. Everything went fine and smooth, till I tried to look for SDK in installation. I could not find it under Android Studio installation. But after a little search on Google and Android Studio configuration on my computer, I was able to find it at
C:\Users\username\Android\sdk
I hope that helps.
C:\Users\*********\AppData\Local\Android\Sdk
Check whether the USERNAME is correct, for me a new USERNAME got created with my proxy extension.
I found it in /Users//Library/Android/sdk
For me it was :
C:\Users\{your-user-name}\AppData\Local\Android\Sdk\tools\bin
Hope it helps!
After installation if you get a message about Proxy, it means that you're probably behind a firewall. You can create a new Outgoing firewall rule to include it. Add this to Allow:
C:\Program Files\Android\Android Studio\bin\studio64.exe
It will then download required SDK components
Once that's done, SDK will be in:
C:\Users\your_user_name\AppData\Local\Android\Sdk
For anyone who really can't find the SDK, you can manually download it from android studio.
File => Settings => Appearance & Behavior => System Settings => Android SDK
If you do not have a SDK (or did not select the right folder), you will be asked to select the SDK version and the folder where the SDK will be installed.
This is how I fixed by SDK not found problem.
System: Ubuntu 16.04 LTS, yet you can try these steps in accordance to your respective systems.
If there is an SDK file present, it should be most likely found at /home/USERNAME/Android/sdk
USERNAME is to be replaced by your username
If there is none, check the specified sdk path for the project in android studio.
File > Project Structure > sdk path
The sdk directory should be present in the specified path. In case, it is not there, open the file:
PROJECT_DIRECTORY/android/local.properties
PROJECT_DIRECTORY needs to be replaced by your project name.
If the file is not there, create it.
Then add the following line depending on where you find the sdk directory.
If sdk is there at /home/USERNAME/Android/:
add the line: sdk.dir = /home/tanya/Android/sdk
If sdk is not there at /home/USERNAME/Android/:
add the line: sdk.dir = /home/tanya/Android/
If the path specified for sdk directory in 'Project Structure' is entirely different and the sdk directory is present at the specified location,
add the line: sdk.dir = SPECIFIED_SDK_PATH
Add the specified sdk path in place of SPECIFIED_SDK_PATH
I've downloaded and installed the Genymotion emulator plugin via the plugin wizard in Android Studio. I'm running Android Studio on a Windows machine.
I'm getting a warning saying that I must provide a path to Genymotion folder:
Where is this folder located? I can not seem to find it in my Android Studio installation folder.
For windows, the default path is C:\Program Files\Genymobile\Genymotion
On a Mac, you will find it here: /Applications/Genymotion.app
You have to enter it inside the Android Studio settings, under Genymotion section.
make sure you have installed genymotion and virtual box then provide the link to genymotion location in windows by default is C:/program files/genymobile/genymotion
Not sure if anyone had the same problem but I received this same warning from Android Studio when clicking on the Genymotion Plugin warning me that
"You must specify a path to genymotion folder to use this feature"
The path was correct according to previous answers for a Mac but the problem was simply that the Genymotion plugin just needed to be updated. I went to Android Studio > Preferences > Plugins > Genymotion and selected update (This is on a mac) and the problem went away after I updated the plugin and restarted Android Studio. Hope this helps someone else with the same problem.
What to do:
Open Genymotion itself (the round & pink icon on your desktop).
Choose the "Settings" option from the upper menu.
Choose the option "ADB" from the upper menu.
Select "Use Android custon SDK tools". Put the following path inside "Android SDK": C:\Program Files\Genymobile\Genymotion
Why does it happen? you're getting the notice "You must specify a path to Genymotion folder to use this feature" because there's a bug in Genymotion working on Windows that misleads the Genymotion engine while trying to use the Android SDK.
Additional links:
Can't find Genymotion.app
On a Ubuntu, you will find it here: /home/user/opt/genymobile/genymotion
For Linux system :
though your genymotion is installed in "/usr/bin" folder its actually points to opt directory in root.
Use following path in android studio for genymotion :
/opt/genymotion
If you are getting this error after clicking installed plugin then, its asking the path of your installed Genymotion. So please provide path where your Genymotion is installed.
In my case it was C:\Program Files\Genymobile\Genymotion
In Linux, the way to solve the issue is the re-run the command
sudo ./genymotion-x.x.x-linux_x64.bin
in the directory where your bin file is located. For instance, suppose that I download the Genymotion .bin file to install Genymotion, and it's in the Downloads folder. I can move it to my home folder and run the following commands to install it.
chmod +x genymotion-x.x.x-linux_x64.bin
sudo ./genymotion-x.x.x-linux_x64.bin
After running those commands, you may run into an issue where the genymotion folder needed to specify the path does not get created. If you try pressing CTRL + h in the directory where your .bin is located, you will find a hidden folder called .Genymobile. The Genymotion folder will be inside of that folder. Even if you were to specify the path to that folder as /home/<user>/.Genymobile/Genymotion, you would still get the error. If you re-run the command sudo ./genymotion-x.x.x-linux_x64.bin where your .bin file is located, it will create the genymotion folder, and you can specify the path as /home/<user>/genymotion if the .bin file is located in your home directory. Once you specify the path, you can press ok, and it should work.
In case it helps, when I needed to add the Genymotion install dir to my $PATH environment variable on Mac OS X, I had to use the following path:
/Applications/Genymotion.app/Contents/MacOS
Simply write
C:\Program Files\Genymobile\Genymotion
It is the default path for the GennyMotion unless you have installed it somewhere else.
To install Genymotion plugin for Android Studio:
In Android Studio, go to File/Settings (for Windows and Linux) or to Android Studio/Preferences (for Mac OS X)
Select Plugins and click Browse Repositories.
Right-click on Genymotion and click Download and install. To see Genymotion plugin icon, display the toolbar by clicking View > Toolbar.
To use this plugin, Genymotion must be installed on your system.
Or download and install manually the plugin genymotion-idea-plugin.jar (not recommended)
You have to give installed path of genymotion.
More Details You can Visit Official Genymotion Website.
Hello I am new in Android development
So as suggested by google I downloaded the latest October 2014 beta version of Android Studio to start developing because they will end up solely with the Android Studio IDE so I thing it is a good idea to get used of it...
To install they just give you a zip file. I unzipped it and followed the text instructions which were simple BUT I cannot find the files and folders the say should exist in their unzipped folder/files :s .
The instructions are
'' To set up Android Studio on Windows:
Unzip the file, android-studio-ide--windows.zip and launch the studio.exe file.
Follow the setup wizard to install Android Studio and the SDK Tools.
On some Windows systems, the launcher script does not find where Java is installed. If you encounter this problem, you need to set an environment variable indicating the correct location.
Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21. ''
Although I find the studio.exe at the path \android-studio-ide-135.1538390-windows\android-studio\bin
I cannot find any kind of a setup wizard for the SDK Tools!!
When I start the studio.exe program and I go to Configure/Project Defaults/Project Structure
the java sdk has been found but the android sdk folder naturally it is not.
And also the Configure/SDK Manager is not enabled.
What obvious thing am I missing here??
Thanks
If you downloaded android-studio-ide-135.1538390-windows, then it only contains the IDE and not the Android SDK. You need to download it separately:
http://dl.google.com/android/installer_r23.0.2-windows.exe
link
You will then point Android Studio to your SDK installation location.
I am trying to make Android programs using IntelliJ. Unfortunately, I cannot get the Android SDK to be recognised on IntelliJ. (I.e. Eclipse has Android SDK Manager installed just fine.)
I select create new project from scratch.
I give the project a name and select make Android module.
Create source directory (next).
The computer then shows Android SDK none. I click the ellipses (...) and the program can see my JDK files.
I click on the + and select Android SDK.
I then find the directory c:\Program Files (x86)\Android\android-sdk.
However, when I click OK a dialog box appears stating "Please select Java SDK". It only gives me the choice of 1.6 (and not the other one 1.7). I then press OK for 1.6.
Finally the computer then reports it cannot find any Android targets in this SDK.
Please help!!!!
Before creating a new Android Project on IntelliJ Idea, you need to configure the Java and Android Development Kits at the IDE level.
Assuming you already installed the JDK and the Android SDK and you just launched IntelliJ (I'm using version 13.0.2):
Press Ctrl+Shift+Alt+S (to access the Project Structure dialog)
On the left navigation pane, click on 'Project Settings->Project'
On the right navigation pane, you should see a drop-down list displaying '<No SDK>'
Click on 'New', select 'JDK' and choose the path to your JDK
Click on 'New', select 'Android SDK' and choose the path to your Android SDK
Please note you have to define the JDK before the Android SDK.
This procedure is documented at:
https://www.jetbrains.com/idea/webhelp/configuring-global-project-and-module-sdks.html
On linux, run tools/android under the SDK to run the Android SDK Manager. Then download one or more of the platforms. Check out "SDK Readme.txt" in the SDK directory for more. Once you're done there, you will be able to select a platform, and your IntelliJ system will start to run.
For others who may encounter this issue on Intellij14 + Mac - the solution that worked for me was to
1) Open intellij - select add android sdk from the project settings section, select the android-sdk-macrox root directory
2) the sdk manager pops up - download at least 1 package.
3) Restart intellij (without this restart, it didnt seem to work)
Oddly, IntelliJ 12 Community doesn't give us the option to select the JDK location for Android projects.
I've found a workaround for this:
First, create a new Java project. I used 'Java Hello World' project. This'll give you the chance to select your JDK.
Install the Android SDK and run the Android SDK Manager to install tools and a platform, as others have mentioned.
Create a new Android project. Under 'SDK', select the Android SDK. Intellij will remember the JDK location you defined in step #1.
On Mac, IntelliJ won't detect the installation of Android SDK. When selecting SDK for new Android module, select your android-sdk-macosx folder as your location.
More info: https://peterboctor.wordpress.com/2010/12/02/installing-the-android-sdk-on-mac-os-x/
Alternatively, Google just releases Android Studio which is a whole IDE base on IntelliJ.
With IntelliJ IDEA 14.1.2, I couldn't select the Android SDK install location on Mac OS X. That install location was ~/Library/Android/sdk, which IntelliJ wouldn't navigate to because ~/Library is a hidden folder. So I created a symlink in my home directory (ln -s ~/Library/Android/sdk/ ~/AndroidSDK) and IntelliJ DID let me select that.
(linux, osx)
When going standalone (without Android Studio), make sure you have the sdk tools (from the standalone sdk, "command line tools" option), build-tools, platform-tools and an sdk (platform).
./tools/bin/sdkmanager --update
# list available packages (pick a version)
./tools/bin/sdkmanager --list
# install requeriments
./tools/bin/sdkmanager "build-tools;26.0.0"
./tools/bin/sdkmanager "platforms;android-26"
# you might get wrong permissions from the downloaded packages
sudo chmod -R +rxw tools # will need write perm to create AVDs
This may help others. I found that I couldn't get IntelliJ (MacOS) to recognise the Android targets in the android-sdk-macosx folder. Moving the Android SDK folder out of the Applications folder and into a directory in my User's folder resolved the issue. IntelliJ was then able to recognise the Android SDK. It may have had something to do with permissions, but no errors were shown to indicate this. Hope this helps.
I had the same problem with version 15 intelliJ after upgrading on OS Linux Ubuntu 12.04
I found because the android sdk wasn't in the home folder of the user running intelliJ that you had to change the Folder/file permissions before it would see this
Mine was in the root
Issuing the command chown -R <yourusername> /path/to/android_sdk_dir
solved the problem for me
If this fails after doing this delete the ~/.ideaC(Lastversion number) any previous ~/.ideaC(Lastversion numbers) folder's and then re open intelliJ
You will have to go through the initialization of the IDE and give the path to your Java installation ver8 upwards only on intelliJ version15 and thereafter your android sdk installation
I found this can also cause conflicts
As a further tip add the following to the very end of your ~/.bashrc using one of your editors my (nano , vi etc )
Example vi ~/.bashrc
The following lines set the Android Path
PATH=$PATH:/path/to/android/:/path/to/android/tools
export PATH
For SDK version r_08 and higher, also add these two lines for adb:
PATH=$PATH:/path/to/android/platform-tools
export PATH
for setting android emulator to 32 bit version add this line
export ANDROID_EMULATOR_FORCE_32BIT=true
Exit your choice of editor (vi , nano etc ) and
Re invoke bashrc with the command below
source ~/.bashrc
Hope that helps you
You need to run SDK Manager.exe to download at least one of the platforms, then you'll be able to select the downloaded platform, see also this tutorial.
If you are behind a proxy server :
1.After starting the Android-SDK-Manager, go to :
Tools > Options.
Add your proxy details.
2.Then go to Packages > Reload
3.After this you should be able to see all the platform options of the Android.
PS : Pheew! Spent an hour figuring this out!
You can create symlink to your sdk location, even to hidden folder. And then point point IDEA to symlink.
For example: ln -s /Users/*username*/Library/Android/sdk /Users/*username*/androidsdk