Android SDK and AVDmanager giving errors - android

I have 64bit system and have downloaded SDK and the manager to learn Android development.
As you can see I am neewbie and I am having few hiccups.
I have downloaded and succesfully installed the plugin for Eclipse.
But when it comes to manager when I am downloading basic packages, I get the error in the screenshot.
I have made sure to fetch the url using http.
the error seems the installer is not able to access its own folder, which is quite surprising.
Are there any permission which I have to change?
I have also included a screenshot for the convenience:
Screen shot http://img842.imageshack.us/img842/1108/capturempk.png

Just two quick things to check:
Make sure you are not running this from within your "Program Files" folder. Run it in Documents or somewhere as Vista & Win7 try to protect any Program Files and folders.
Right click the application and look for the option to always run it as administrator. Even in Linux based operating systems you need to run this updater as administrator some times.
These are just two quick solutions, just in case.

Related

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

Android Studio AVD Manager Creating AVDs in root directory

I am using Android Studio with Ubuntu and it won't create AVDs. Nothing gets created in my ~/.android/avd directory. Instead things are getting created in my /root directory. Which I guess I wouldn't care about, except of course it can't run the emulator for these AVDs if the AVDs are in my root folder. I think it's because for the Android SDK manager to be accessed in Linux, Android Studio has to be run with sudo...but then it puts the AVDs in root instead of home...
I have a few pics outlining this problem very clearly, but stackoverflow won't let me even link to them without 10 rep, what a nuisance of a restriction.
EDIT: Here is the error I get in my terminal when I try to execute the android bash script located in /opt/android-studio/sdk/tools/. It's the same error whether or not Android Studio is open or not.
ss108 tools$ bash android
java.lang.NullPointerException
at java.io.File.<init>(File.java:277)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1516)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1492)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:346)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:369)
at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:252)
at com.android.sdklib.internal.repository.updater.UpdaterData.<init>(UpdaterData.java:120)
at com.android.sdkuilib.internal.repository.SwtUpdaterData.<init>(SwtUpdaterData.java:61)
at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.<init>(SdkUpdaterWindowImpl2.java:104)
at com.android.sdkuilib.repository.SdkUpdaterWindow.<init>(SdkUpdaterWindow.java:88)
at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:407)
at com.android.sdkmanager.Main.doAction(Main.java:390)
at com.android.sdkmanager.Main.run(Main.java:150)
at com.android.sdkmanager.Main.main(Main.java:116)
The AVDs are created under /root because you are starting Android Studio with sudo. You need to configure the permissions so that this isn't required. The simplest solution that I have found is to install Android Studio and the Android SDK as my regular user. I install these into $HOME/bin so that I don't have to bother with permission issues at all. When everything is installed, my regular user account has execute permission for all the files I need.
Alternatively, you can use chmod (either manually or with find) to set the permissions on Android Studio and Android SDK files.

Unable to Download Packages via Android SDK Manager

I have recently installed Android SDK on my computer running Windows 7 x64.
I then installed the Eclipse ADT plugin. I am running Eclipse Juno JEE.
When I attempt to run the SDK Manager through Eclipse, I receive the following errors:
Nothing I have tried has allowed me to download/install/update Android SDK and its packages.
I have tried https and forcing http
I have tried running calling program as administrator.
I have added Eclipse, SDK Manager to Firewall exceptions.
I have turned off my antivirus.
I have turned off my firewall.
I have tried various combinations of the above.
I can navigate my browser to both URLs (using Firefox). That should negate "Failed to read..." options 1 and 2. Option 3 seems to be the likely candidate as the XML files do not, in fact, include the <'xsd:schema'> tag. However, I don't know how, if, or where I might be able to point SDK Manager to a local, modified copy of these XML files, or if that would even solve anything.
Any help would be greatly appreciated.
Note: I have installed Android SDK/ Eclipse ADT Plugin on the same machine in the past. This is a fresh install after a recent reimage.
I am not sure if this answer's your question exactly to the point but yet I hope this helps you.
As u wrote it looks like you have downloaded eclipse from its website and android sdk separately from Android website. Why don't you download the Android SDK ADT package with pre-eclipse setup.
That will make your job way lot easier.
The file name would be something like this:
adt-bundle-windows-x86_64-20130729.zip

Cannot create Android Emulator with AVD Manager

I'm having problems with creating an Emulator from the AVD Manager. The error dialog says
Failed to pare properties from C:\User\Giti.androud\avd\Emulator.a
How can i fix this?
Are you using the Eclipse ADT plugin, or attempting to do this yourself? If using Eclipse, double check that you have the IDE pointing to the proper SDK installation directory, it is not done for you. Also recall that when you download the android SDK, it comes with very few things, so the AVD manager must be used to download all of the necessary components from their respective repositories. You can see this if you open the AVD manager and view the installed packages. Hope this helps. Posting more information about your installation will be even more helpful as these steps are just the bare minimum to get up and running with Eclipse. Good Luck.
EDIT:
You didn't mention whether you're using Eclipse or not, so I think it's important to note that it is strongly recommended that you use Eclipse with the ADT plugin, as android binaries are first built by the java compiler and then translated to dalvik binary. This is just one of many concepts that you'd have to worry about without using Eclipse.
ANOTHER EDIT:
Based on the error message you posted, I'm assuming that it says "Failed to parse properties from C:\User\Giti.androud\avd\Emulator.a". There should obviously be a "\" between Giti and .android. I'm not sure if this was your error or if this is exactly what you saw, in which case Eclipse is building the path string incorrectly. How exactly are you building the AVD? Are you doing anything special, e.g. setting the resolution, pixel density different? When you use the AVD manager, it will create two entries under C:\Users\Giti.android\avd\, one of which is a file named .ini and a directory called .avd which contains the system image and some other configuration settings for the virtual device. I would first recommend double checking that directory to ensure that these files are there and open them up in notepad to view the settings to ensure that nothing appears malformed, e.g. weird spaces or characters appearing in odd places. Most of the properties you'll see are straightforward enough that you can detect malformation easily. Please also post the version of Eclipse that you are using. Are you new to it? Have you had it installed before and are just now trying to use the ADT plugin? Eclipse is very useful but can get pretty complicated when using different configurations.

Huh? Android Preferences page refuses to load after adding SDK 1.6

This one is really weird. I had a perfectly working Eclipse + Android 2.2 SDK working in both Administrator account and LUA (Limited User Account) under Windows XP.
Then I decided to add the Android 1.6 SDK (I could do it from an Administrator account only). It seemed to have gone well, since it still works perfectly -- but only in that Administrator account!
When I try to start Eclipse under a LUA, I receive the following error message box:
Which disappears within 2-3 seconds and replaced with:
I then tried to check the Preferences page, but again, all I receive is error messages:
and:
Any idea why this is happening and how to fix this?
(I would love to be able to continue working from a LUA)
Update: I have uploaded the error log file (referred to in the "Show Error Log" in the message boxes), for your expert examination. Hopefully this can shed some light on the mystery.
The full answer is somewhat complex, concerning Eclipse's configuration area, the workspace area, etc. This is all documented on the Eclipse site, if you're interested.
But there's a simpler, more immediate approach, since you're not trying to run multiple users simultaneously on the same copy, over a network -- in which case you'd need the full answer.
Simply install Eclipse in a directory, say, C:/dev/Eclipse. Make sure both your limited user and your admin have write access to everything. Run Eclipse as the limited user. It should start right up, as there's nothing privileged that is needed by Eclipse.
At this point, you can lock it down as read-only if you desire. By default, all the configuration is stored within the Eclipse installation directory.
I'd suggest starting with a fresh install at this point, to eliminate any inconsistencies that you may have introduced. Though you should be able to reset things by deleting all the subdirectories of the configure/ directory (but not the config.ini). There's an official way to do that, but that's part of the full answer. :=)
I'd also suggest using a different workspace for each user, to avoid any permissions problems.
But my BIG suggestion is -- upgrade to Windows 7, and do NOT run Eclipse as an administrator!
Anyway, once you have it working -- to upgrade in the future, make the Eclipse directory completely writable by the limited user, and then update as the limited user, and then make it read-only again if needed.
Note: This is the cheating way. The REAL answer is to give each user their own configuration directory. This is only viable because you have control over both users and can coordinate any updates.
Try running eclipse by downloading the binary and unzipping and directly running the .exe rather than "installing" it. The android tools should work this way if you configure the appropriate paths to them, and if eclipse isn't "installed" but simply run from a the archive folder, it should try to download plugins and such into its own directory (owned by your user), which may solve your problem.
I doubt the Android developers who built the tools run under LUAs, so they probably didn't run into this problem...
Workaround found: Run Eclipse as Administrator (Right-click exe/shortcut, then select "Run as...", then enter Administrator's password).
This is a workaround, not a solution, but it does allow me to continue working while logged in LUA.
Thanks to #David who suggested this solution here: Android ADT Plugin doesn't show up in Eclipse
Update: Solution found:
Enable the Security tab in Windows XP Pro (""Use Simple File Sharing.")
Add the LUA account to C:\eclipse with Modify permissions.
That's it. No need to run Eclipse via "Run as". Also eliminates the need for a fresh install (which takes more time).

Categories

Resources