I have android studio setup on my Ubuntu machine and now whenever I try to start the emulator, it throws exception like:
Cannot launch AVD in emulator.
Output:
PANIC: Could not find
Nexus_S_API_21.ini file in $ANDROID_AVD_HOME$ nor in $HOME./android/avd
So when I do:
echo $ANDROID_AVD_HOME
It shows empty which means that this path is not set and when $HOME is my /home/user
So when I go in /home/user/.android/avd there is really no .ini file. So, I am confused, when I create a virtual device, where does it go? How can I find the path where virtual devices are being created and if possible, how can I change the path to create virtual devices?
You can find location of your avd's *.ini files in AVD Manager (GUI).
Right under tab "Android Virtual Devices" there is line "List of existing Android Virtual Devices located at %here is the location%".
You can try to change system variable %android_avd_home% to something like /home/user, for example and then restart IDE (Android Studio).
Also, you can try to find useful information here: https://code.google.com/p/android/issues/detail?id=78577
Hope it helps
I experienced this same issue on OSX, but the weird part was it only happened after I had added the ANDROID_SDK_HOME varible to my environment.
I experimented and found that if I added the ANDROID_AVD_HOME variable to my environment or I removed ANDROID_SDK_HOME, it caused it to start working.
One solution at this problem is to copy the file's emulator which exited and rename it in the name of the new emulator; that is say the android studio name of emulator who is try to run.
NB : Before I suppose you had install the eclipse ADT which contains one or some emulator
Example :
1) cd .android/avd/
2) ls -al
3) cp .ini .ini
4) Finish run the emulator in your android studio by the AVD
This happens on Windows when the user home folder is changed from the default one. To make Android Studio happy just add a system enviroment variable and set it to your home folder, for example:
ANDROID_SDK_HOME = D:\Users\max\
Related
I cannot start a virtual devices on android SDK when I press the start button on AVD manager, this error shows on my screen:
Starting emulator for AVD 'AVD_for_Galaxy_Nexus_by_Google'
PANIC: Could not find AVD_for_Galaxy_Nexus_by_Google.ini file in
$ANDROID_AVD_HOME nor in $HOME/.android/avd"!
Here is the screen shot:
You'll just have to set the ANDROID_AVD_HOME environment variable and restart Android Studio.
just this command worked for me : sudo cp -R /root/.android $HOME
I solved this problem, on Ubuntu, by finding where the .avd and .ini files from the AVD manager were downloaded. By default, these are named after the virtual device created in the AVD manager and will be like this: Nexus_4_API_22.ini and will have a .ini and .avd file both with the same name. In my case, they were located in /root/.android/avd/.
From there, I copied both the ini and avd files of the virtual device (If you have more than one, copy all of the virtual devices you want) into $HOME/.android/avd/, as that is one of the locations the message requested. On linux, sudo cp /root/.android/avd/Virual_Device_XX.ini $Home/.android/avd/ and do the same with the .avd file. Hope this helps anyone who runs into this issue.
For me the Environment variable was missing altogether.
adding "ANDROID_AVD_HOME" as environment variable solved it.
also a tip, enter the path without the "/.android/avd" part, as the application automatically adds this to it's search you don't need to specify them anymore.
e.g.
Env. Variable : ANDROID_AVD_HOME
Value : C:\users\%USERNAME%\Androidapps
Android studio will for emulators under C:\users\%USERNAME%\Androidapps.android\avd
Just create a symlink:
ln -s /root/.android/ /home/user/.android/
This way you will solve the issue with the emulator because all sdk data is being written on /root/.android/
Or instead ANDROID_AVD_HOME enter ANDROID_SDK_HOME and Studio will work: Cannot start avd emulator on android studio 1.0
I just encountered this problem again and realized that newer versions of Android Studio and SDK are placing AVDs along the following path for OSX:
Users/yourUsername/Library/Android/sdk/.android/avd as opposed to the older practice of placing AVDs here: Users/yourUsername/.android/avd
So, I just updated my bash_profile file to point ANDROID_AVD_HOME to the new location--which did indeed contain the ini file for the AVD I'd created, and then the launch went fine.
because android SDK environment ANDROID_SDK_HOME, wrong path. /usr/local/opt/android-sdk or /Users/[userName]/Library/Android/sdk TRUE
Make sure your ANDROID_SDK_HOME or ANDROID_AVD_HOME is defined correctly and AVD is installed in AVD Manager.
You can get the avd folder path by clicking view details of any AVD you have installed.
Directories are searched by emulator in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME\avd and $HOME.android\avd .
Check whether the avd folder path matches any of the above path. Make sure there is no empty avd folder in any of the above path of defined environment variables.
Try changing the environment variable definition from ANDROID_AVD_HOME to $ANDROID_AVD_HOME.
I installed Eclipse Kepler and the Android development tools. Everything is working fine, except for when I try to run my Android code in an emulator I get the following error:
Emulator] PANIC: Could not open: [name of Android virtual device]
I Googled the problem but I have not found a solution. It might have to do with the Android path or perhaps authorizations, but I do not know where I have to change them to.
I hope someone can help me out.
This has been asked a few times already, try this:
Create a environment variable called: ANDROID_SDK_HOME and set it to
C:\Users\Administrator
Open Eclipse > Window > Preferences and click in Run/Debug and String
Substitution
Add a new variable called: user.home and set it to
C:\Users\Administrator
Create an AVD and run it.
As a work-around, you can define the environment variable
ANDROID_SDK_HOME to point to the directory containing your .android
directory. The emulator and SDK Manager will pick it up properly.
Original answer by: Colin Pickard
To change the ANDROID_SDK_HOME variable in Ubuntu (as requested in the comment):
Edit your .profile file with a command like gedit ~/.profile and append the following to the end of the file:
export ANDROID_SDK_HOME=/your/android-sdk/path/here
Here's a list of some variables you can modify for Android Tools.
export PATH=${PATH}:~/android-sdk-linux_x86/tools
export PATH=${PATH}:~/android-sdk-linux_x86/platform-tools
export ANDROID_SDK_HOME=~/android-sdk-linux_x86/tools
export PATH=$PATH:$ANDROID_SDK_HOME
Similar Questions
Android Emulator can't start, 'cause of wrong folder
I have problem in a emulator
android emulator error:[2011-08-02 11:14:01 - Emulator] PANIC: Could not open: C:\Users\hallo\.android/avd/myemu.ini
I want to write an Android app and I've started this morning by loading JDK, eclipse, SDK etc, all from the adt-bundle-windows-x86_64-20130219 from http://developer.android.com.
The issue for me right now:
[2013-02-27 13:36:26 - Test2] Android Launch!
[2013-02-27 13:36:26 - Test2] adb is running normally.
[2013-02-27 13:36:26 - Test2] Performing com.example.test2.MainActivity activity launch
[2013-02-27 13:37:27 - Test2] Launching a new emulator with Virtual Device 'droidX2'
[2013-02-27 13:37:27 - Emulator] PANIC: Could not open: droidX2
I've been sifting though posts on the web all morning about AVD and I haven't seen one that didn't involve the path being messed up and the .ini not found. I don't think I've got a path issue. AVD is looking for files on D:\USERS\XXX\.android\avd and that's where the files are. So don't understand why the emulator can't open.
I've done the most basic things like remove and re-install everything, read the notes at orace etc. Basically I'm stuck. Any suggestions here?
adt-bundle-windows-x86_64-20130219 was what I loaded on Windows 7 (32bit).
I'd settle for testing on the mobile that's connected to the PC but I can't get that to work either!
Any direction appreciated.
This has been asked a few times already, try these:
Create a environment variable called: ANDROID_SDK_HOME and set it to
C:\Users\Administrator Open Eclipse > Window > Preferences and click
in Run/Debug and String Substitution Add a new variable called:
user.home and set it to C:\Users\Administrator Create an AVD and run
it.
Original answer by Colin
an android project member says here:
As a work-around, you can define the environment variable
ANDROID_SDK_HOME to point to the directory containing your .android
directory. The emulator and SDK Manager will pick it up properly.
verify that The location in which the avd was searched from is different from where it is actually created. Take a look at the screenshot below for more information.
ANOTHER OPTION: Symlinking...
In a command prompt (with admin privileges), change directory ("cd") to "C:\Users\YourUserName.android" and then use the following command to create a symlink to the avd directory (notice the direction of the slashes):
mklink /D avd D:\_MyLibrariesDir\.android\avd
Where "_MyLibrariesDir" is the directory that your libraries (photos, documents, etc) folders are located.
And you're done!
Explanation: This has the same effect as the ANDROID_SDK_HOME option except that you can now browse to [C:\Users\YourUserName\.android\avd\*] and [D:_MyLibrariesDir\.android\avd\*] and both will take you to the same spot.
This differs from a shortcut in that shortcuts do not act as directories, so if you just had a shortcut to the "avd" folder, you could not go to "C:\Users\YourUserName\.android\avd*" as it would produce a file not found error and if you tried to click on an avd shortcut file it would take you to [D:_MyLibrariesDir\.android\avd\*] instead of keeping you on the C drive. Symlinks act a bridge between locations in a way that is transparent to user and software. Quite handy :)
I fixed the AVD Panic issue by running Eclipse as an administrator.
On Ubuntu check the current user if you run eclipse as root (sudo) eclipse could NOT find the /root/.android set the user home
user.home /home/<user>/
and copy the AVD files into the new directory than changes the privileges
cd /home/<user>/
chgrp <user> -R .android
chgrp <user> -R .android
Simply if nothing works for you, just copy the folder avd which you could find in your .android folder to C:\Users\<user name>\.android.
Pls check once in Ur ".android" folder, another/duplicate ".android" folder might have been created. If "YES" is Ur answer then do this thing because in my case that thing was happened.
Simply I just kept only the latest ".android" folder in this directory "C:\Users\USER NAME\" (removed the duplicated one) and then emulator started working for me.
Cheers
try to add new windows admin user with English language only
it worked for me
the user name should be in English letters
Found a simple way to make it work - worth trying:
1. If you do not have it yet - create a new AVD with the problematic name (in this case droidX2) if you see an overwrite warning - overwrite it.
2. Delete the new AVD you just created in step 1.
3. If you have another AVD it's OK, if not - create one.
4. Retry running the Eclipse project as an Android application - now it should run
Setting the ANDROID_SDK_HOME environment variable alone works fine for Win7 and earlier but did not help me on Win8.
For poor tortured souls using the piece of crap which is Windows 8, go to wherever you've installed the Android SDK (e.g. C:\SDK\Android or C:\Users\JoeCitizen\AppData\Local\Android\android-sdk) and make sure both AVD Manager.exe and SDK Manager.exe are set to run as Administrator for all users. Once I did that it worked fine.
Yet another deceptive problem-which-shouldn't-be-a-problem caused by the complete fail which is permission management circa Windows 8.
Using Windows 7, Eclipse, Android SDK tools 23.0.4
First time I followed the exact instruction on http://developer.android.com/training/index.html
I got the error "PANIC: could not open.." whenever 'Start' emulator.
Solution: System property popup/Enviroment Variables/ System variables, Added new entry
name="ANDROID_SDK_HOME", value = "D:\DATA\Users\ThisUser\"
Then it starts work!
"D:\DATA\Users\ThisUser\" is parent folder where ".android/avd" folder exists.
avd folder path here is "D:\DATA\Users\ThisUser.android\avd"
Note that you must put "D:\DATA\Users\ThisUser\", not "D:\DATA\Users\ThisUser**.android**"
Getting NullPointerException when trying to start avd. I just downloaded the ADT bundle for Mac and ran android avd. Anyone know why it would fail?
$ ./android avd
java.lang.NullPointerException
at com.android.sdklib.internal.avd.AvdInfo.getDeviceName(AvdInfo.java:158)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.fillDevices(DeviceManagerPage.java:497)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.fillTable(DeviceManagerPage.java:357)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.createContents(DeviceManagerPage.java:259)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.<init>(DeviceManagerPage.java:130)
at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.createDeviceTab(AvdManagerWindowImpl1.java:210)
at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.createContents(AvdManagerWindowImpl1.java:193)
at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.open(AvdManagerWindowImpl1.java:133)
at com.android.sdkuilib.repository.AvdManagerWindow.open(AvdManagerWindow.java:94)
at com.android.sdkmanager.Main.showAvdManagerWindow(Main.java:369)
at com.android.sdkmanager.Main.doAction(Main.java:311)
at com.android.sdkmanager.Main.run(Main.java:119)
at com.android.sdkmanager.Main.main(Main.java:102)
The following worked for me:
From the command line I navigated to the tools folder of the Android-SDK folder. From there I ran this command:
android list avd
This produced a list of all of my virtual devices but one of them showed itself to be the problem. The exact output was as follows:
The following Android Virtual Devices could not be loaded:
Name: Tab31
Path: /Users/User/.android/avd/Tab31.avd
Error: Failed to parse properties from /Users/User/.android/avd/Tab31.avd/config.iniere
If you see this then make note of the "Name" property ("Tab31" in my situation) and run the following command (obviously replacing the name of my AVD with yours):
android delete avd -n Tab31
After that I was able to start the AVD Manager without any problem.
I had this exact same problem last night and finally found the ways to get the emulator to start working:
List the available targets with: android list targets
android create avd -n {name} -t {targetID}
(for {name} I chose Tablet - believe its arbitrary)
== Still wasn't working but then I discovered =>
I right-clicked above the manifest.xml file, selected option Run As ->
Run Configurations -> on a tab Target, and selected AVD created.
(from Eclipse launch error when trying to run an Android app)
If nothing of the above solutions work, deleting the .android folder in the home directory will work
I had this same problem after moving around my Android SDK and changing the base directory by setting the environment variable ANDROID_SDK_HOME. Turns out there is a path inside of the following file (path below ANDROID_SDK_HOME).
.android/avd/nameofphone.ini
The "path=" setting in that file is absolute, so if you move around your files it will not be correct anymore. Changing that to the correct absolute path to the avd-file in the same directory fixed my issue.
It's usually because creation of a new AVD failed or the configs for one of your AVDs is corrupted.
Go to ~/.android/avd
Check the list of AVDs. If you think one of those AVDs is causing the problems, sudo rm -r (UNIQUE PART OF AVD NAME)*
This removes that AVD. Then re-try android avd
#BreakingBad's solution works fine except when the config is corrupted
It looks like this issue has been fixed in version 21.0.1 preview 1 of the SDK Tools.
http://code.google.com/p/android/issues/detail?id=40400
The most likely cause is an invalid properties file that could not be parsed by the AVD Manager. Updating to the Preview Channel of the SDK Tools should fix this, or you can just wait for the official release.
Once I updated, the AVD Manager started and showed an invalid AVD in my list, which I was able to delete.
everybody,
I am facing a weird problem in mac osx. I have installed eclipse(Indigo 64 bit) on my mac machine with ADT r15. and android sdk with API level 7. everything works fine but when i create a virtual device and launch it, i always get error
PANIC: Could not open: /tmp/.android/avd/avd_2.1.ini`
The problem is that eclipse looks for avd at location /tmp/.android/avd/ but avd is actually located at /var/root/.android/avd.
Is there any workaround.
Thanks
N_JOY
In Windows you should add the environment variable, there's probably such a thing in Mac OS but i'm not really familiar with that..
check this: (number 5 is your goal)
http://fyi.oreilly.com/2009/02/setting-up-your-android-develo.html
This is just a patch but solved my problem. As eclipse is looking for avd inside tmp directory. so i have created .android/avd directory in tmp folder.
NOTE: you can't create any directory whose name starts with'.'. so you should create it from terminal.
and then copy original contents from /var/root/.android/avd to /tmp/.android/avd/
N_JOY.
I encountered the same problem but I was able to managed it though.
What I did is that I copied the contents of .android folder (from the root -- /var/root/.android) to the tmp (/tmp/.android).
Since in MAC OS you cannot create/open folder that name's start from a dot (e.g. -- .android folder), you have to do it manually using the terminal.
Even the folder is created by the AVD Manager, you will not be able to see it unless you do it manually in the terminal.
Usually what the AVD Manager does is that it creates a .android folder in the root and it doesn't care if you were able to see it. What is important to him is that he created it.
First you must create a device to the emulator then click 'Details' to make sure where it is located. Then open the .android folder in the Terminal (using the location you saw in the Details but usually it is in the /var/root/ directory).
Open Terminal, type open /var/root/.android
Second copy that directory to the tmp folder.
type cp -R var/root/.android /tmp
Restart Eclipse and Run the Device using the AVD Manager.
Now, the Device will be open.
NOTE: Since this is a temporary folder, you have to copy the contents of the .android folder in the tmp folder every time you open your MAC.
Seems this is related run the eclipse using root instead of normal user. You can also use symbol link:
ln -s /var/root/.android /tmp