Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVD Manager on Android Studio 1.5.1 and install to a custom location emulator won't run

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

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: registry values

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: AVD Manager Create new device

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.
enter image description here

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

download image

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

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. only one 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.

like image 798
raddevus Avatar asked Feb 08 '16 14:02

raddevus


2 Answers

You should look in the idea.properties file in your project (Android Studio path to different directories). It sounds like this is set to override the system's settings.

like image 190
Code-Apprentice Avatar answered Oct 28 '22 15:10

Code-Apprentice


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: system image

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.

google api LEVEL 15

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:

still accesses network path

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).

Uninstall

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

enter image description here

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.

like image 40
raddevus Avatar answered Oct 28 '22 16:10

raddevus