eclipse Android SDK AVD 错误:空
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6162788/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android SDK AVD Error:null
提问by kaffein
When I try installing the Android SDK onto eclipse, I can not create a new virtual device. I keep getting this error [2011-05-28 12:05:16 - SDK Manager] Error: null. Is there any way I can fix this
当我尝试在 Eclipse 上安装 Android SDK 时,我无法创建新的虚拟设备。我不断收到此错误 [2011-05-28 12:05:16 - SDK Manager] 错误:空。有什么办法可以解决这个问题
How I Fixed This Problem deleted all the files in my workspace. Reset and it started working.
我如何解决此问题删除了我工作区中的所有文件。重置并开始工作。
回答by kaffein
same issue here on MAC OS X. Here is my configuration.
MAC OS X 上有同样的问题。这是我的配置。
bigboy:platform-tools kaffein$ uname -a
Darwin bigboy.home 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64
The Why
为什么
It is a problem with the permission settings of your ~/.android/avd folder. Since virtual device emulator settings and configurations are written in this folder, the SDK tools (avd manager in this case) has to be able to write in this directory.
您的 ~/.android/avd 文件夹的权限设置有问题。由于虚拟设备模拟器设置和配置都写在这个文件夹中,所以 SDK 工具(在这种情况下是 avd 管理器)必须能够在这个目录中写入。
The how
如何
First, check your ~/.android/avd permissions using the ls Unix command (cd to your home directory) :
首先,使用 ls Unix 命令(cd 到您的主目录)检查您的 ~/.android/avd 权限:
bigboy:~ kaffein$ ls -al .android/
drwxr-xr-x 5 kaffein staff 170 Jan 5 14:35 .
drwxr-xr-x+ 53 kaffein staff 1802 Jan 5 21:22 ..
-rw-r--r-- 1 root staff 123 Jan 5 14:08 adb_usb.ini
-rw-r--r-- 1 root staff 131 Jan 5 14:35 androidwin.cfg
drwxr-xr-x 2 root staff 68 Jan 5 12:48 avd
the avd folder belongs to root. You can begin by changing the owner of this folder to yourself using the following command.
avd 文件夹属于根目录。您可以首先使用以下命令将此文件夹的所有者更改为您自己。
bigboy:~ kaffein$ cd .android/
bigboy:.android kaffein$ sudo chown kaffein:staff *
check again to see that you are now the owner of the folder using the following command :
使用以下命令再次检查以查看您现在是该文件夹的所有者:
bigboy:.android kaffein$ ls -al
total 16
drwxr-xr-x 5 kaffein staff 170 Jan 5 14:35 .
drwxr-xr-x+ 53 kaffein staff 1802 Jan 5 21:22 ..
-rw-r--r-- 1 kaffein staff 123 Jan 5 14:08 adb_usb.ini
-rw-r--r-- 1 kaffein staff 131 Jan 5 14:35 androidwin.cfg
drwxr-xr-x 2 kaffein staff 68 Jan 5 12:48 avd
you should have an output like the one above (of course, kaffein should be your username)
你应该有一个像上面那样的输出(当然,kaffein应该是你的用户名)
Finally, you should change the permission settings on the avd/ folder using the following command :
最后,您应该使用以下命令更改 avd/ 文件夹上的权限设置:
bigboy:.android kaffein$ sudo chmod a+rw avd/
check that you actually changed the settings with ls -al command.
检查您是否确实使用 ls -al 命令更改了设置。
bigboy:.android kaffein$ ls -al
total 16
drwxr-xr-x 5 kaffein staff 170 Jan 5 14:35 .
drwxr-xr-x+ 53 kaffein staff 1802 Jan 5 21:22 ..
-rw-r--r-- 1 kaffein staff 123 Jan 5 14:08 adb_usb.ini
-rw-r--r-- 1 kaffein staff 131 Jan 5 14:35 androidwin.cfg
drwxrwxrwx 2 kaffein staff 68 Jan 5 12:48 avd
avd is now set to 777.
avd 现在设置为 777。
Final step
最后一步
From your Eclipse IDE, open the AVD manager and try to create a virtual device. Taaadaaaa!!!! Everything should work...
在 Eclipse IDE 中,打开 AVD 管理器并尝试创建虚拟设备。啊啊啊啊啊啊啊!!!!一切都应该工作...
I hope it helped ...
我希望它有帮助...
回答by yi2ng2
Just for sharing purpose, I got the error of [2011-10-20 10:07:17 - SDK Manager] Error: null and I resolved the problem by setting up the environment variable ANDROID_SDK_HOME over Control Panel.
只是为了分享目的,我收到了 [2011-10-20 10:07:17 - SDK Manager] Error: null 的错误,我通过在控制面板上设置环境变量 ANDROID_SDK_HOME 解决了这个问题。
Start -> Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables -> New
开始 -> 控制面板 -> 系统和安全 -> 系统 -> 高级系统设置 -> 环境变量 -> 新建
Variable Name: ANDROID_SDK_HOME Variable Value: (the path is be your desired location of .android folder, excluding the last slash) For Example: C:\Users\myUsername
变量名称:ANDROID_SDK_HOME 变量值:(路径是你想要的 .android 文件夹的位置,不包括最后一个斜杠) 例如:C:\Users\myUsername
Cheers!
干杯!
回答by shello
I had the same problem just now.
我刚才遇到了同样的问题。
Starting the android tool and trying to add a AVD gave me a "Permission Denied" error on my ~/.android folder (Mac OS X here).
启动 android 工具并尝试添加 AVD 时,我的 ~/.android 文件夹(此处为 Mac OS X)出现“权限被拒绝”错误。
I bet it's too much but this solved the problem for me:
我敢打赌这太多了,但这为我解决了问题:
- Exit the android tool or the Eclipse AVD Manager;
- Remove the .android directory;
- Start the android tool again and try adding AVDs.
- 退出android工具或Eclipse AVD Manager;
- 删除 .android 目录;
- 再次启动 android 工具并尝试添加 AVD。
Voilà. With this I was able to add new AVDs both via the tool (when started directly) and Eclipse.
瞧。有了这个,我能够通过工具(直接启动时)和 Eclipse 添加新的 AVD。
I'm pretty sure I messed up the permissions in some way, and that the most correct solution to this problem is to fix the permissions of this directory.
我很确定我以某种方式弄乱了权限,并且解决此问题的最正确方法是修复此目录的权限。
回答by Roberto Leinardi
Nothing suggested in here worked for me, I was still getting the error on my CentOS 7 server.
这里没有任何建议对我有用,我的 CentOS 7 服务器仍然出现错误。
After some more digging I find out that the issue was related to the creation of the SDCard:
经过更多挖掘,我发现问题与 SDCard 的创建有关:
$ avdmanager -v create avd --force --name avd_5568 --package 'system-images;android-25;google_apis;x86' --sdcard 256M --abi google_apis/x86 --device "4in WVGA (Nexus S)"
Warning: Failed to create the SD card.
Warning: Failed to create sdcard in the AVD folder.
Error: AVD not created.
null
And after some more googling i figured out that I had to install some required dependency.
经过更多的谷歌搜索后,我发现我必须安装一些必需的依赖项。
Required libraries for 64-bit GNU/Linux machines:
If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
64 位 GNU/Linux 机器所需的库:
如果您运行的是 64 位版本的 Ubuntu,则需要使用以下命令安装一些 32 位库:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
If you are running 64-bit Fedora, the command is:
如果您运行的是 64 位 Fedora,则命令为:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
回答by twlkyao
I also encountered this problem on Linux, I found it was the permission issue,I solved the problem by adding the writing permission to the eclipse user, you can also solve this by change the owner of the file to the eclipse user, hope you will benefit from this.
我在linux上也遇到过这个问题,我发现是权限问题,我通过给eclipse用户添加写权限解决了这个问题,你也可以通过将文件的所有者更改为eclipse用户来解决这个问题,希望你能从中受益。
回答by Cbas
If your still having this problem, I found a solution (on Windows 7). My console was giving me the exact same error and Eclipse said that my android sdk was not in the right location - even though it was - whenever I opened eclipse.
如果您仍然遇到这个问题,我找到了一个解决方案(在 Windows 7 上)。我的控制台给了我完全相同的错误,Eclipse 说我的 android sdk 不在正确的位置 - 即使它是 - 每当我打开 eclipse 时。
To fix this, right click on your android-sdk folder, go to properties, security, then under the "Group or user names" list, make sure each one (especially "trusted installer") has full permissions for the file - make sure all the "allow" boxes are checked. Next time you start up the SDK Manager, you should be able to download everything with no problem.
要解决此问题,请右键单击您的 android-sdk 文件夹,转到属性、安全性,然后在“组或用户名”列表下,确保每个人(尤其是“受信任的安装程序”)都对该文件具有完全权限 - 确保所有“允许”框都被选中。下次启动 SDK Manager 时,您应该可以毫无问题地下载所有内容。
回答by Android
i think your problem is you cant create virtul device right?
The easiest way to create an AVD is to use the graphical AVD Manager, which you launch from Eclipse by clicking Window > Android SDK and AVD Manager.
OR
You can also start the AVD Managerfrom the command lineby calling the android tool in the tools directory of the Android SDK.for commands guide/developing/tools/emulator.htmlthen you should see this video
and then -android-emulator-managing-android-virtual-devices-avd
我认为您的问题是您无法创建虚拟设备,对吗?
创建 AVD 的最简单方法是使用图形 AVD 管理器,您可以通过单击 Window > Android SDK 和 AVD Manager从 Eclipse 启动它。
或者
您也可以启动AVD管理从命令行通过调用了Android SDK.for命令tools目录中的机器人工具指南/开发/工具/ emulator.html那么你应该看到这个视频
,然后-Android-emulator-管理-android-virtual-devices-avd
回答by Bjarke
Did you solve your issue? I had a similar issue on my mac but I solved it last night. I had not write acces to my disk with my user account which made it impossible to start a virtual machine. So I changed my permission to read/write which solved the issue.
你的问题解决了吗?我的 mac 上也有类似的问题,但我昨晚解决了。我没有使用我的用户帐户对我的磁盘进行写入访问,这使得无法启动虚拟机。所以我改变了我的读/写权限,解决了这个问题。
回答by Bryan
Not sure if this is your problem but I've seen this happen when the SDK Manager is looking in the wrong directory for Android Virtual Devices. I would double check this and make sure it's correct, you'll see it at the top of the Android SDK and AVD Manager window.
不确定这是否是您的问题,但我已经看到当 SDK 管理器在错误的 Android 虚拟设备目录中查找时会发生这种情况。我会仔细检查并确保它是正确的,你会在 Android SDK 和 AVD 管理器窗口的顶部看到它。
回答by Eason
I got same problem. I downloaded the SDK package (for windows 64bits) from the android developer website, when I created AVD, I got an error: "[2013-03-14 ... SDK manager ] error: null".
我遇到了同样的问题。我从android开发者网站下载了SDK包(适用于windows 64位),当我创建AVD时,出现错误:“[2013-03-14 ... SDK manager] error: null”。
Run Eclipse.exe as administrator, then it works, I can create an AVD.
以管理员身份运行 Eclipse.exe,然后就可以了,我可以创建一个 AVD。