简体   繁体   English

如何为Android 4.0创建AVD

[英]How to create an AVD for Android 4.0

Android 4.0 is now released. Android 4.0现已发布。 I have just updated my ADT plugin and downloaded the 4.0 SDK. 我刚刚更新了我的ADT插件并下载了4.0 SDK。 But when I try to create an AVD for Android 4.0, Eclipse tells me 'Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder'. 但是当我尝试为Android 4.0创建AVD时 ,Eclipse告诉我'无法为ABI armeabi找到'userdata.img'文件以复制到AVD文件夹中'。

I found d:\\android-sdk-windows\\platforms\\android-14 missing the 'images' folder which other versions have. 我发现d:\\android-sdk-windows\\platforms\\android-14缺少其他版本的'images'文件夹。 This folder may have 'userdata.img' that create an AVD should have. 此文件夹可能具有创建AVD应具有的“userdata.img”。

Where should I to get 'userdata.img', and how do I create an AVD for Android 4.0? 我应该在哪里获得'userdata.img',以及如何为Android 4.0创建AVD?

I just did the same. 我也做了同样的事。 If you look in the "Android SDK Manager" in the "Android 4.0 (API 14)" section you'll see a few packages. 如果您查看“Android 4.0(API 14)”部分中的“Android SDK Manager”,您会看到一些软件包。 One of these is named "ARM EABI v7a System Image". 其中一个名为“ARM EABI v7a系统映像”。

This is what you need to download in order to create an Android 4.0 virtual device: 这是您需要下载以创建Android 4.0虚拟设备:

Android SDK下载系统

Another solution, for those of us without an internet connection to our development machine is: 对于我们这些没有与我们的开发机器连接的人来说,另一个解决方案是:

Create a folder called system-images in the top level of your SDK directory (next to platforms and tools ). 在SDK目录的顶层( platformstools旁边)创建一个名为system-images的文件夹。 Create subdirs android-14 and android-15 (as applicable). 创建子目录android-14android-15 (如适用)。 Extract the complete armeabi-v7a folder to these directory; 将完整的armeabi-v7a文件夹armeabi-v7a到这些目录; sysimg_armv7a-15_r01.zip (from, eg google's repository ) goes to android-15 , sysimg_armv7a-14_r02.zip to android-14 . sysimg_armv7a-15_r01.zip(来自谷歌的存储库 )转到android-15 ,sysimg_armv7a-14_r02.zip到android-14

I've not tried this procedure offline, I finally relented and used my broadband allowance at home, but these are the target locations for these large sysimg's, for future reference. 我没有尝试离线这个程序,我终于心软了,并在家里使用了我的宽带限额,但这些是这些大型系统的目标位置,供将来参考。

I've tried creating the image subdirs where they were absent in 14 and 15 but while this allowed the AVD to create an image (for 15 but not 14) it hadn't shown the Android logo after 15 minutes. 我已经尝试在14和15中创建它们不存在的image但是这允许AVD创建图像(15但不是14)它在15分钟后没有显示Android徽标。

此网站Android Create AVD向您展示如何在Eclipse中安装最新版本的Android SDK和AVD版本4,如果您仍然卡住了视频和屏幕截图?

I had a similar problem but using IntelliJ IDEA rather than Eclipse . 我有一个类似的问题,但使用IntelliJ IDEA而不是Eclipse I already had the ARM EABI installed, but I still got the error. 我已经安装了ARM EABI,但我仍然遇到错误。

For IntelliJ IDEA, it appears you also have to create an AVB first before running the emulator, so to do this you must just go into Android SDK Manager and create a new AVB. 对于IntelliJ IDEA,您似乎还必须在运行模拟器之前先创建AVB,因此,为此,您必须进入Android SDK Manager并创建新的AVB。 This should solve your problem... Please make sure you have followed the above answer to include the ARM before following these steps. 这应该可以解决您的问题...在执行这些步骤之前,请确保您已按照上述答案包含ARM。

You can also get this problem if you have your Android SDK version controlled. 如果您控制了Android SDK版本,也可以解决此问题。 You get a slightly different error: 你得到一个稍微不同的错误:

Unable to find a 'userdata.img' file for ABI .svn to copy into the AVD folder. 无法找到ABI .svn的'userdata.img'文件以复制到AVD文件夹中。

For some reason, the Android Virtual Device (AVD) manager believes the .svn folder is specifying an application binary interface (ABI). 出于某种原因,Android虚拟设备(AVD)管理器认为.svn文件夹指定了应用程序二进制接口 (ABI)。 It looks for userdata.img within the .svn folder and can't find it, so it fails. 它在.svn文件夹中查找userdata.img但找不到它,因此失败。

I used the shell extension found in the responses for the Stack Overflow question Removing .svn files from all directories to remove all .svn folders recursively from the android-sdk folder. 我使用了Stack Overflow问题的响应中找到的shell扩展从所有目录中删除.svn文件,从android-sdk文件夹中递归删除所有.svn文件夹。 After this, the AVD manager was able to create an AVD successfully. 在此之后,AVD经理能够成功创建AVD。 I have yet to figure out how to get the SDK to play nicely with Subversion . 我还没弄明白如何让SDK与Subversion很好地配合。

If you installed the system image and still get this error, it might be that the Android SDK manager did not put the files in the right folder for the AVD manager. 如果您安装了系统映像但仍然出现此错误,则可能是Android SDK管理器未将文件放在AVD管理器的正确文件夹中。 See an answer to Stack Overflow question How to create an AVD for Android 4.0.3? 查看Stack Overflow问题的答案如何为Android 4.0.3创建AVD? (Unable to find a 'userdata.img') . (无法找到'userdata.img')

This answer is for creating AVD in Android Studio. 这个答案是在Android Studio中创建AVD。

  1. First click on AVD button on your Android Studio top bar. 首先单击Android Studio顶部栏上的AVD按钮。

图片1

  1. In this window click on Create Virtual Device 在此窗口中单击“ 创建虚拟设备”

图片2

  1. Now you will choose hardware profile for AVD and click Next. 现在,您将为AVD选择硬件配置文件,然后单击下一步。

图片3

  1. Choose Android Api Version you want in your AVD. 在AVD中选择您想要的Android Api版本。 Download if no api exist. 如果没有api则下载。 Click next. 点击下一步。

图片4

  1. This is now window for customizing some AVD feature like camera, network, memory and ram size etc. Just keep default and click Finish. 现在,这是自定义某些AVD功能的窗口,如相机,网络,内存和柱塞尺寸等。只需保持默认值,然后单击完成。

图片5

  1. You AVD is ready, now click on AVD button in Android Studio (same like 1st step). 您已准备好AVD,现在点击Android Studio中的AVD按钮(与第1步相同)。 Then you will able to see created AVD in list. 然后,您将能够在列表中看到创建的AVD。 Click on Play button on your AVD. 单击AVD上的“播放”按钮。

图片6

  1. Your AVD will start soon. 你的AVD很快就会开始。

图片7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM