Android Studio emulator is not working

我是研究僧i 提交于 2019-12-10 03:54:41

问题


i´ve searched about an awnser for this problem, tried many things, but still it doesn't Work. I'm using a win7 64-bit version. I've set the ANDROID_SDK_HOME variable and... nothing. With the path: C:\Users\Nuno\Favorites\.android\avd

The error is this:

Cannot launch AVD in emulator.
Output:
PANIC: HOME is defined but could not find PhoneTest.ini file in $HOME\.android\avd
(Note: avd is searched in the order of $ANDROID_AVD_HOME,$ANDROID_SDK_HOME\.android\avd and $HOME\.android\avd)

Can someone help me?


回答1:


It's working now!

How did i solved? I copied the AVM's i created from c:\user\favorites.android\avd and pasted them at c:\user.android\avd.

Tbh i don't know why this happened but when i installed Android studio it created the first directory to put the avd's, while the HOME variable points to the second directory.

After that i had a second problem, it said it couldn't create the temp file... I just had to execute Android studio with administrative privileges.

I hope it helps.




回答2:


I was facing same issue when installed and configured android studio on ubuntu 14.04 (64 bit).

After installation android studio successfully, when I run my app, I faced below issue:

Cannot launch AVD in emulator. Output: PANIC: HOME is defined but could not find Nexus_5_API_21.ini file in $HOME/.android/avd (Note: avd is searched in the order of $ANDROID_AVD_HOME,$ANDROID_SDK_HOME/.android/avd and $HOME/.android/avd)

I discovered reason of issue and find solution of the same. Reason was that I had downloaded android_studio at home directory (path:/home/ubuntu/android_studio). When I started studio (by using command: $sudo sh /home/ubuntu/android_studio/bin/studio.sh), which is actually installed at path /root/, it is trying to access "root" user files at path /root/.android/avd

Ready to use solution is: Use command with root user ie

#sh /home/ubuntu/android_studio/bin/studio.sh

in place of of

$sudo sh /home/ubuntu/android_studio/bin/studio.sh




回答3:


Im glad you have solved the problem. This is the ubuntu version of your problem. This explains why you need to admin privileges.




回答4:


Add environment variables ANDROID_AVD_HOME or ANDROID_SDK_HOME as your emulator really in(show in capture below). avd manager create emulator in maybe in another directory(default C:\Users[User Name].android\avd on Windows). As message show in tips, avd will search xxxx/.android/avd. So you setting environment variables above can solve the problem. enter image description here




回答5:


When AS was updated in Parallels and HAXM was installed after disabling Hyper-V, for me, the new avds somehow found their way into the Mac's .android folder? I previously installed AS on the Mac but wanted to separate Xcode and AS, so I used Windows for AS and uninstalled it on the Mac. When I opened AS from the dock, it was as if it was a fresh install and I didn't import settings...

Solution was to grab all my old emulators (folders and .ini files) and pasted them into the Window's .android/avd folder.




回答6:


Worked with me by setting the variable ANDROID_SDK_HOME and path D: \ ANDROID_SDK in S.O Windowns 7 Thanks




回答7:


I might not be answering your question but I strongly encourage you to switch for a new Android Emulator. Works prietty good for me:

Genymotion Home Page



来源:https://stackoverflow.com/questions/29014116/android-studio-emulator-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!