Android Studio 1.5.1 上的 AVD 管理器并安装到自定义位置模拟器将无法运行 [英] AVD Manager on Android Studio 1.5.1 and install to a custom location emulator won't run

查看:13
本文介绍了Android Studio 1.5.1 上的 AVD 管理器并安装到自定义位置模拟器将无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Android Studio(1.5.1——构建细节见图片).

在安装时,我选择了自定义选项,因此我可以安装特定路径.我知道我的 %SystemDrive% 指向一个网络位置,我想安装到我的本地磁盘.

因此,这意味着默认情况下,应用程序将安装到:\networkpath\users\myUserName\Android\SDK

但是,由于我选择了自定义安装,所以我选择了本地路径:c:\users\myUsername\Android\SDK

项目创建和构建工作正常

一切似乎都安装得很好,我能够创建一个新项目并顺利构建它.

但是,当我尝试运行构建的程序然后基本上无声无息地失败了.模拟器从未出现,也没有发生错误.Android Monitor 仅显示一条消息,指出未检测到连接的设备.AVD 管理器

幸运的是,我对检查模拟器的情况有所了解,然后我打开了 AVD 管理器.列出的设备显示错误.我右键单击该设备并选择查看详细信息".那是 AVD 管理器显示它正在尝试从网络路径读取的时候,即使我在自定义安装中更改了它.\networkPath\Users\myUserName\Windows.android\avd\Nexus4.avd和\networkPath\Users\myUserName\Windows.android\avd\Nexus4.ini

注册表编辑

我关闭了 Android Studio.然后我打开 regedit 并在以下位置编辑值:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList最初如下所示:

并更改它们,使它们都直接指向 c:\ 驱动器(而不是 %systemdrive%)

环境变量:ANDROID_SDK_HOME

我发现其他人提到了 ANDROID_SDK_HOME 环境变量,我注意到我的机器根本没有定义那个值,所以我添加了它并像下面这样设置它:c:\users\myUsername\Android\SDK

然后我再次启动了 Android Studio 并启动了 AVD 管理器.这次没有显示设备,而是 AVD Manager 提示我使用以下窗口创建一个:

现在,我正在尝试使用 Google API 下载其中一个设备,但每次我下载并安装成功,然后从列表中消失.请注意,在下图中,没有用于 arm 架构的 Google API 的 API 级别 15 或 16.

另外请注意, 列出了一个带有 arm 的 API 级别 17.我现在将尝试安装那个.

可以看到下载成功,安装正常.现在,我单击 [Finish] 按钮.该项目不再出现在我的列表中.

API 级别 15 项是自动选择的.我假设是因为那个是在我安装 Android Studio 时最初下载的.

最后,如果您取消选中 [ ] 显示可下载的系统映像复选框 - 这非常令人困惑 - 我假设向您显示您已经下载的那些,那么您会看到它只显示一个API 级别 15 虚拟设备.

这一切都非常可怕.有没有人见过这个问题?有没有其他人能够修复它?

我假设我只需要重新安装 Android Studio.

解决方案

EDIT 2 With Final Solution

多亏了一个警觉和精明的 SO 海报 (

但是,它仍然没有显示我之前安装的其他 API 级别(15、16 等).

已从磁盘中删除它们

我注意到它们位于以下位置的本地文件夹中:%userprofile%\Android\SDK\附加组件无论出于何种原因.我删除了该路径下的所有文件夹,带有 Google 选项的原始 API 再次出现在我的列表中.查看图像中突出显示的项目.

解决方案现在,当我安装它们时,它们会显示在列表中,我可以基于它们创建新的 AVD.一切正常.

编辑我用我写的一个工具来观察 Android Studio 写入磁盘的位置,我找到了一个揭示问题的路径:

即使我进行了大量更改以确保安装完全安装在我的本地磁盘上,Android Studio 仍将一些(大量)数据保存到此路径中.

我在 .AndroidStudio 1.5\config\ 上做了一个 Google这让我找到了以下文档:

然后我再次安装了整个东西,看起来好像默认选择了正确的安装路径:

但是,当我重新启动 Studio 时,它打开了我在第一次安装时创建的项目.

另外,我仍然看不到我之前安装的 API 映像.只有那一张图.没有别的.

这真的不是一个很棒的安装系统.我正在写一本有助于开始 Android 开发者的书,但如果他们陷入这个问题循环,则无法通过运行良好的模拟器让他们摆脱困境.

非常不幸.

I installed Android Studio (1.5.1 -- see image for build details).

While installing I chose the custom option so I could install a specific path. I knew that my %SystemDrive% was pointed at a network location and I wanted to install to my local disk.

So, this means that by default, the application would've installed to : \networkpath\users\myUserName\Android\SDK

However, since I chose the custom installation I chose a local path: c:\users\myUsername\Android\SDK

Project Creation and Build Work Fine

Everything seemed to install fine and I was able to create a new project and build it with no problems.

However, when I attempted to run the built and then basically failed silently. The emulator never appeared and no error occurred. Android Monitor just shows a message stating that No Connected Device detected. AVD Manager

Luckily I knew a bit about checking to see what happened with the emulator and I opened up AVD Manager. The listed device displayed an error. I right-clicked the device and chose "View Details". That's when the AVD manager showed that it is attempting to read from the network path, even though I changed this in the custom installation. \networkPath\Users\myUserName\Windows.android\avd\Nexus4.avd and \networkPath\Users\myUserName\Windows.android\avd\Nexus4.ini

Registry Edit

I closed Android Studio. Then I opened regedit and edited the values at: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList which originally looked like the following:

And changed them so they all point directly to the c:\ drive (instead of %systemdrive%)

Environment Variable : ANDROID_SDK_HOME

I found that others have mentioned the ANDROID_SDK_HOME environment variable and I noticed that my machine doesn't have that value defined at all so I added it and set it up like the following: c:\users\myUsername\Android\SDK

I then started Android Studio again and started the AVD Manager. This time there were no devices show, but instead AVD Manager prompted me to create one with the following window:

Now, I'm attempting to download one of the devices with Google APIs, but each time I do, they download and install successfully, but then disappear from the list. Notice, in the next image there are not API Level 15 or 16 with Google APIs for arm architecture.

Notice additionally that there is one listed for API Level 17 with arm. I will now attempt to install that one.

You can see that it downloaded successfully and installed fine. Now, I click the [Finish] button. The item no longer appears in my list.

The API Level 15 item is chosen automatically. I'm assuming because that one was downloaded originally when I installed Android Studio.

Finally, if you uncheck the [ ] show downloadable system images checkbox -- which is terribly confusing -- and I'm assuming shows you the ones you've already downloaded, then you'll see that it only shows the one API Level 15 virtual device.

This is all quite terrible. Has anyone seen this problem? Has anyone else been able to fix it?

I'm assuming that I'll just have to go and do a complete re-install of Android Studio.

解决方案

EDIT 2 With Final Solution

Thanks to an alert and astute SO post-er (code-apprentice) I was able to get to a solution.

Here's what I had to do.

  1. create idea.properties file and place it at the \networkLocation\myUserName\.Android 1.5\
  2. place the two lines in it which point to my local disk

idea.config.path=C:/Users/myUserName/.AndroidStudio1.5/config/ idea.system.path=C:/Users/myUserName/.AndroidStudio1.5/system/

Then I started Android Studio again and I attempt to install a system image which included the Google APIs. It worked and it was added to the list:

However, it still did not show the other API LEVELS which I had installed before (15, 16, etc).

Deleted Them From Disk

I noticed that they had been located in a local folder at : %userprofile%\Android\SDK\add-ons for whatever reason. I deleted all of the folders under that path and the original APIs with Google choices appeared in my list again. See highlighted item in image.

SOLUTION Now when I install them they show up in the list and I can create new AVDs based upon them. Everything works.

EDIT I used a tool I wrote to watch where Android Studio wrote to disk and I found a path that reveals the problem:

Even though I've made extensive changes to insure the installation would install completely on my local disk, Android Studio saves some (a lot) of data out to this path.

I did a Google on : .AndroidStudio 1.5\config\ That led me to the following documentation: http://tools.android.com/tech-docs/configuration

There, you will see that the installation should be using %userprofile% to determine where it writes this data. My %userprofile% points to my local disk (c:\users\myUserName) but Android Studio still insists on writing data out to the network.

Here's the important information: Windows:

%USERPROFILE%\.{FOLDER_NAME}\studio.exe.vmoptions 
 and/or 
%USERPROFILE%\.{FOLDER_NAME}\studio64.exe.vmoptions
        %USERPROFILE%\.{FOLDER_NAME}\idea.properties

I deleted the remote .Android Studio 1.5 directory and copied it to my %userprofile% (local) directory. Then I restarted Android Studio and it thinks that it needs to generate all that again because it wants to place it at the remote directory again.

Core issue:

Obviously, it is not using %userprofile%


It gets worse. I uninstalled the application and all of the settings (supposedly).

Then I installed the entire thing again and it looked as if it were choosing the correct installation path by default:

But, when I started Studio back up then it opened up the project I had created with the first install.

Plus, I still cannot see the API image that I supposedly installed before. Only that one image. Nothing else.

This is really not a great installation system. I'm working on a book which helps beginning Android Devs but if they fall into this problem loop there is no way to get them out of it with a good running emulator.

Very unfortunate.

这篇关于Android Studio 1.5.1 上的 AVD 管理器并安装到自定义位置模拟器将无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆