可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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.
回答1:
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.
回答2:
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.
回答3:
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 :)
回答4:
I fixed the AVD Panic issue by running Eclipse as an administrator.
回答5:
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
回答6:
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
.
回答7:
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
回答8:
try to add new windows admin user with English language only
it worked for me
the user name should be in English letters
回答9:
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
回答10:
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.
回答11:
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**"