7

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.

raddevus
  • 8,142
  • 7
  • 66
  • 87
  • What's your question? I don't see which part you have a problem with. How did you API 17? Be sure you downloaded a **system image** rather than the API 17 SDK. – Code-Apprentice Feb 08 '16 at 19:26
  • I believe you are asking how did I download API 17? I clicked the "download" link from the System Image (Select a system image) page -- within the AVD Manager as I've shown above -- to download API 17 system image. My questions are, why do the APIs with Google disappear? Why can't I select them as the image to run with the AVD I'm trying to run? Why don't they show up anywhere? – raddevus Feb 08 '16 at 19:32
  • [This screenshot](http://i.stack.imgur.com/1U2Ye.png) shows that you downloaded API 17 with Google APIs. It doesn't show you downloaded an image for the emulator. – Code-Apprentice Feb 10 '16 at 19:53
  • That's a good catch. That's another bug with Android Studio. I clicked the item on the Android Studio screen titled, Virtual Device Configuration - System Image (Select A System Image) and that screen I showed (and in your previous message) followed. So, you seem to have uncovered the fact that Android Studio does _not_ download a system image but instead downloads an SDK. The point is, Android Studio again leads the user to believe s/he is downloading a system image but instead downloads an SDK. Maybe you can submit it as a bug. – raddevus Feb 10 '16 at 20:51
  • I am unable to reproduce this. When I click on the Download link, I get a window with different messages that clearly indicate that I am downloading a system image. – Code-Apprentice Feb 10 '16 at 20:55
  • Tools...Android...AVD Manager... Create a new device... System Image (Select a System Image) window appears Choose API Level 21 arm (With Google APIs) -- for example You cannot go further in the AVD Manager (Next isn't available) so you click the blue "download" link next to API Level 21 System Image. When you click that download link, that is when you'll see the SDK window you mentioned. Once that completes, AVD MAnager will allow you to click [Next] button. etc. Does this help? – raddevus Feb 10 '16 at 21:00
  • As I said, when I do that, I see different messages. – Code-Apprentice Feb 10 '16 at 21:03
  • Okay, so the difference may be that my %systemdrive% is pointing to a network drive and that may still cause some problem. Are you testing on a machine with %systemdrive% pointing off box? Well, actually, I'm wrong. I edited %systemdrive% so it points locally, however, remember my Android Studio still thinks something is at the offbox %systemdrive% . Maybe that setting is in the registry somewhere for Android Studio. – raddevus Feb 10 '16 at 21:08
  • I am currently running on OS X which might be different as far as handling paths is concerned. – Code-Apprentice Feb 10 '16 at 21:20

3 Answers3

1

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.

Community
  • 1
  • 1
raddevus
  • 8,142
  • 7
  • 66
  • 87
  • This seems like a kludgey solution. It would be nice to figure out **why** you were seeing the original behavior. – Code-Apprentice Feb 08 '16 at 23:01
  • Well, we'd probably have to have more input from the Android Studio developers (IntelliJ) and the people who created the installation package. I believe the root problem is related to the way Studio and/or the installation sets up the paths to installation location related to the configuration of Android Studio. Since mine had network paths for %systemdrive% it offset some setting in Android Studio configuration when I installed. I've installed on a machine where the %systemdrive% is local and no such problems arise. – raddevus Feb 09 '16 at 03:30
  • Yes, your installation in your original question is quite unusual. – Code-Apprentice Feb 09 '16 at 18:39
  • I would agree with you if the Android Studio installation didn't allow me to pick my installation location and (erroneously) lead me to believe that everything I'm installing is installed in that location. Instead, the installation allows me to pick a local disk location, but then also writes data to an unmentioned location at %systemdrive%. And that causes all of the problems. And, the workaround solution is to create a file (idea.properies) at %systemdrive% location which points to my local installation. That, I believe is the oddity and that is related to the Android Studio installation. – raddevus Feb 09 '16 at 19:37
1

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.

Community
  • 1
  • 1
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
0

Download the respective SDK and API levels and Image Systems on Android SDK Manager.

And then they'll show up normally on AVD.

Hongbin Wang
  • 1,186
  • 2
  • 14
  • 34