I am using Mac OS X, and Eclipse IDE, and when I try to run a sample project, i.e. Snake etc, I cannot access my newly made Android Virtual Device because it was saved to another directory, and not within my workspace, to the best of my understanding.
I tried to modify the run configurations for my project, but cannot detect the AVD because it is in another directory, and I cannot figure how to change this directory and run my sample application.
I am just starting android development, and I cannot even run a sample app. :-( I installed the necessary plug-in and all the necessary packages.
In Eclipse got to Window -> AVD Manager. What do you see there? There is no option to choose a directory to store an AVD and it is not stored within your workspace. If you installed everything correctly you should be able to configure an AVD here in AVD Manager and it will be seen by your Android Project at Run or Debug time. Make sure the API level is correct in the AVD.
Related
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.
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.
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.
create idea.properties file and place it at the \networkLocation\myUserName\.Android 1.5\
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.
Download the respective SDK and API levels and Image Systems on Android SDK Manager.
And then they'll show up normally on AVD.
Is it necessary to download android sdk for each and every system we install android studiod? Isnt there a way to copy the whole setup from one computer to another ?
Copying the whole Android Studio Folder (don't has to be installed on C) should work.
Not tested!
Android website have options to download only the sdks whichever you want.
And then when you install Android Studio afterwards, when it first opens it will ask you to point out the path for Android SDK either on the first windows that pops up or in the settings tab.
So just copy the SDKs into the system everytime you have to install Android Studio and just simply point it out from it.
So just now I decided to switch over to Android Studio from Eclipse, everything seems to be fine except that I can't even find the menu to add a new virtual device.
On the Android dev website it says it should be in Tools>Android>AVD Manager or to execute "android avd" from the tools directory, but I don't have a tools directory.
I installed it with pretty much all the default settings so i don't know how it's not there.
Fixed itself sort of. I tried running a project and android studio had a message come up there that allowed me to install the part that was missing, I don't know why I didn't have it at the beginning though.
I have built android from source with this instructions and soon I got a generic full-eng build. It also launching in emulator. Now I need to use this android distributive for testing any specific software.
I also have customized eclipse for working with android SDK and AVD; and those are working well too. But I need to change usable android virtual device to self-built android. I didn't find the necessary settings in AVD manager.
How to do I do this?
I found solution!
1) Create in AVD manager new device with same API with as your self-built project is.
2) Go to ./out/target/product/$device/
3) Copy next files: hardware-qemu,ramdisk.img, system.img, userdata.img, userdata-qemu.img
4) Go to ~/.android/($device that we have created in step 1) and paste just copied files.
5) Now you can test your eclipse projects on self-built android.
I Have the whole Eclipse Android sdk working. Everything but the virtual device manager. I downloaded to Bundle from androids website, installed java JDK into the eclipse folder, then housed the entire bundle in a folder on my desktop. When I go to hit the "Androd Virtual Device Manager" button, nothing happens. Nothing at all. It used to work ( i could never run the program though, I could just open the window to make anew device)
Make sure you have properly installed/updated sdk to the latest version
https://developer.android.com/sdk/installing/adding-packages.html
Try running the C:\android-sdk-windows\AVD Manager
I had the same problem, I am running windows 7 home basic on my laptop.
Do the following steps :
You need to first copy your entire java folder(the one containing the java sdk) to a location where administrator rights are not required.
Change the path variable by going to the advanced tab in My Computers and adding a new environment variable.
once you do that, go to the folder where you have your entire android sdk and in its parent folder search for the file named android.bat.
go to the properties of the file found and copy the entire address
go to cmd and type-cd"the path you copied".
you are in the tools folder and now type android.bat and press enter..
it takes some time like 30-40 sec and then opens our beloved sdk manager, and you are there.