Android SDK fails to install - android

When I try to install the android SDK it fails to install.
My OS is Windows XP
I just downloaded and installed Java JDK 1.6
Java -version from the command line returns:
https://stackoverflow.com/questions/ask
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
My environment vars have:
JAVA_HOME=c:\progra~1\java\jdk1.6.0_11
I downloaded android-sdk-r04-windows.zip
I unziped it in V:\AndroidInstall\
When I go to the
V:\androindinstall\android-sdk-windows>
and type "SDK Install.exe" nothing happens...
If I go this from graph
When I do this from a graphical file viewer I get a quick flash that looks like a command line window and nothing....
When I try to run
android list targets
from the tool directory I get:
Error: Error parsing the sdk.
Error: V:\androindinstall\android-sdk-windows\platforms is missing.
Error: Unable to parse SDK content.
So the basic install setup is not happening.
Additional clues:
I have a G1 and Android 1.0 was running on this machine. (Almost a year ago)
I've updated my G1 to 1.6 so I thought I'd update my SDK before starting new development.
When I tried to upgrade it tried and then died as the "directory was in use"
So I cleaned out all the android directories, rebooted and redownloaded everythign from scratch.
Now it won't run at all.
I've clearly got something in an unhappy state, but I've cleaned up all the directories and no remanants seem to be running I've rebooted....
I've missed somethign I just can't figure out what.
Paul

You should manually create 2 more directories under your root sdk dir 'android-sdk-windows':
platforms
add-ons
and than start SDK Setup.exe from the root directory or try to open it from Eclipse
'Window' -> 'Android SDK and AVD manager'

Run the SDK setup
Wait for the error message
Disable anti virus
Install this unlocker program http://download.cnet.com/Unlocker/3000-2248_4-10493998.html
Run the unlocker program
select the tools directory to unlock it
select yes in the installer.
This is what worked for me.
http://code.google.com/p/android/issues/detail?id=4410#c41

The directories "platforms" and "add-ons" need to be manually installed in the android SDK directory (parallel to "tool"). This is only necessary in a new installation.

I had the same problem, adding the directory add-ons got rid of the error when eclipse is first open but I still couldn't download packages from the sdk manager.
What solved this problem for me (in windows 8) is running eclipse as administrator.

I got this error from my Jenkins CI.
It was because the Jenkins user did not have permissions on the android-sdk-linux folder.
(not the best solution but fixed it with):
sudo chmod -R 777 /usr/bin/android-sdk-linux

Related

Cannot run XAMARIN UI TEST on xamarin.forms, error System.Exception

I want ton run Xamarin UI test, but when i run the test i have this error :
System.Exception : 'The running adb server is incompatible with the Android SDK version in use by UITest:
C:\Program Files (x86)\Android\android-sdk
my start command-line :
return ConfigureApp.Android.ApkFile("/Users/Jerem/source/repos/App4/App4/App4.Android/bin/Debug/com.companyname.App4-Signed.apk").StartApp();
Thanks for our helping
If you have the same error, check in our sdk directory if you have platform-tools and platform-tools.oldxxxx, delete old ! Just work after
Y Nakamura's answer moved me in the right direction but it still took me a long time to solve because I wasn't sure exactly what I was trying to solve. I'm going to expand on the answer here in case others run into the same problems that I did.
As mentioned, the problem seems to be caused by the files (not sure if it's adb.exe or other files) inside of platform-tools not being supported by Xamarin.UITest. platform-tools can be found in C:\Program Files (x86)\Android\android-sdk
I had platform-tools folder, plus two additional folders with old12341234 suffixes (the numbers didn't make any sense to me).
To figure out which version of adb.exe is in each folder:
Open one of the folders
Hold shift and right-click in the windows explorer window to see the Open PowerShell window here option
In PowerShell, run the command ./adb.exe version to see the version number you are running
In my case, the version that was too new was 1.0.40. I found a folder that had 1.0.39. I renamed the platform-tools folder that was too new to platform-toolsTooNew. I then renamed the folder that contained adb.exe v 1.0.39 to platform-tools, then restarted Visual Studio.
After doing all of that, my automated tests once-again worked!
Update November 2020
I was able to run with a newer version of ADB, but I had to delete the old folder from my android-sdk folder. I am using:
ADB version 1.0.41
Visual Studio 16.6.5
Xamarin 16.6.000.1064
Xamarin.Android SDK 10.3.1.4
I'll keep my original post above in case it helps others.
Android SDK Platform-Tools 28.0.0 (40) is too new. Try restoring 27.0.1 (39). Open folder %ANDROID_HOME%. If the folders platform-tools and platform-tools.oldxxxx appears, rename them to restore old version.

Can't update \tools - Android SDK Command Line Tools for Windows

I have just downloaded the Android SDK Command Line tools for Windows (26.0.2). I am attempting to download selected SDK components using \tools\bin\sdkmanager.bat, as well as updating \tools. The installation fails with the following message:
Warning: An error occurred during installation: Failed to move away or delete existing target file: C:\testinstall\sdk\tools
Move it away manually and try again..
I don't see how I can remove \tools manually because it contains \bin\sdkmanager.bat.
Screenshot of the sdkmanager command:
All other components appear to install without error. See below for the components specified in my package file:
Yeah that's quite funny. A way to do that is to copy the tools folder to another place (let's say C:\temp\). Then direct into the C:\temp\tools\bin\, open the cmd prompt there and run your update commands as such:
sdkmanager.bat --sdk_root=sdkRootPath --command
Where sdkRootPath is path to your original SDK folder (C:\testinstall\sdk\). Once that is done, delete the C:\temp\tools\ copied folder.
You could temporarily rename to tools.old, run it to install new version in tools and then remove the old one.
cd YOUR-ANDROID-SDK-LOCATION
ren tools tools.old
tools.old\bin\sdkmanager.bat "tools"
dir tools*
del tools.old /q /s
tools\bin\sdkmanager.bat --list
it might be permission issue.Can you try doing sudo or if you on windows try to run terminal as administrator.
I have seen issues where the program is not able to delete the folder either due to lock or some weird reason.
Run cmd in root c:.
c:\>testinstall\sdk\tools\bin\sdkmanager --package_file=c:\testinstall\packx.txt
I've had the same issue on windows, I couldn't even rename the directory that is causing the issue.
I found out that adb was still running and ended the process and update/install worked fine without workarounds.
The below command helped me to extract the SDK
sdkmanager "platform-tools" "platforms;android-28" --sdk_root=C:\AndroidSDK_RootLocation
It may not be the answer to your question but now, i can't exactly remeber the version, you can't update SDK tools directly or using Eclipse, sdk Manager, sdk.bat or android.bat, only way is to update them using Android Studio. It's Google's new policy, i read it somewhere, if i find the link i will share it
My solution was as following:
Delete the Android SDK Tools via Android Studio (although it might complain it failed).
Close Android Studio
Manually delete tools folder from C:\Users\<MyUsername>\AppData\Local\Android\sdk folder
Start Android Studio and then do the install of the Android SDK Tools via Android Studio.

Ruboto: Android SDK Tools is missing

I'm trying to develop android apps using Ruboto. I can't seem to get it all up and running though. When I try to run something like:
ruboto gen app --package com.test.me --name Test --target android-17
I got the following output:
Found '/usr/bin/adb' but it is not in a proper Android SDK installation.
RuntimeError: The '<ANDROID_HOME>/tools' directory is missing.
Please set the ANDROID_HOME environment variable to a proper Android SDK installation.
I have followed the guide on the Ruboto git site (https://github.com/ruboto/ruboto/wiki/Environment-setup-for-ubuntu) but whatever I do, I still get that error. When I manually go to the directory, the tools directory isn't missing.
Some extra info:
I am using Ubuntu 13.10.
I installed every SDK after running android in the terminal.
I am using jruby through rvm

Cordova-CLI & PhoneGap-CLI do not see android sdk

I've created app with "phonegap create" command. Then I switch to project dir and try to run it with "phonegap local run android" and I have next error message:
Please install Android target 17 <...>
Android SDK is placed to C:\dev\sdk
My PATH variable contains C:\dev\sdk; C:\div\sdk\platforms\;C:\dev\sdk\platform-tools
I run "android" command from cmd and SDK Manager shows no updates or no missed sdk files.
I tried create and run project with cordova cli but had same problem.
What can it be?
It seems that for latest Cordova (3.0.6),
cordova platform add android
command only recognize Android 4.2.2(API17) SDK. After I install the API17 SDK, the error was gone.
Not sure if there is a cordova command option that can specify SDK version.
I had just the same problem (error message) with os x (10.8).
After executing the command android in the Terminal some android-packet-management-UI popped up. There i could install stuff that made it run ..
I had API17 installed but was still getting this error.
I needed to install apache-ant, set ANT_HOME=C:\Program Files\Java\apache-ant\, JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21\ and add both bin's to my PATH += C:\Program Files\Java\jdk1.7.0_21\bin;C:\Program Files\Java\apache-ant\bin
See https://stackoverflow.com/a/13986997/956397
I had the same problem and the very most simple way to resolve it is changing the target in project.properties to 16 and try.
it seems if you type "android" at the same command prompt you type your cordova commands, you get a separate Android SDK manager then the one launched via Eclipse and so then there you select the appropriate packages and updates to achieve the version number of the Adroid SDK required. For me I'm guessing it's from an adt-bundle I installed with _? (I don't know actually no clue) that runs instead.
My best guess is the installer when updating doesn't doesn't update the path correctly.
Ya you need to manually correct duplicates and anomalies in the path.
Point to the "sdk" folder and tools of a valid most current adt-bundle-windows folder.
Maybe it was NetBeans that did this?
No it seems plausible when I put an update of Eclipse (C:\Library\Dev\Android\adt-bundle-windows-*) I must have not realized I needed to update the path too having done it manually the first time to get it to work.
It seems I needed plateform-tools added as well for adb to run the emulate command...
C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\tools;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools;

Android installation/SDK Manager issues

I have downloaded android-sdk_r08-windows.zip and installed it in c:\. When I try to run the SDK Manager, it briefly pops up a DOS window then closes. Trying to run adroid update sdk results in a null pointer exception. I have tried uninstalling/reinstalling the SDK for both android and java multiple times. This is on windows XP SP3. Any ideas?
Thanks,
John
C:\android-sdk-windows>java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
C:\android-sdk-windows>tools\android.bat update sdk
[INFO] Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
java.lang.NullPointerException
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1155)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1134)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:376)
at com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:230)
at com.android.sdkuilib.internal.repository.UpdaterData.<init>(UpdaterData.java:107)
at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.<init>(UpdaterWindowImpl.java:86)
at com.android.sdkuilib.repository.UpdaterWindow.<init>(UpdaterWindow.java:54)
at com.android.sdkmanager.Main.showMainWindow(Main.java:297)
at com.android.sdkmanager.Main.doAction(Main.java:260)
at com.android.sdkmanager.Main.run(Main.java:99)
at com.android.sdkmanager.Main.main(Main.java:88)
Apparently my system had a residual .android folder lying around from when I played around with the android SDK over a year ago. Renaming that file resulted in the SDK Manager coming up.
Make sure the JDK path is added to the Environmental variables.Its usually happenes when a JDK/JRE uninstall is succeeded by another JDK install
Have you installed the JDK, rather than the JRE?
Also, check that your JAVA_HOME variable points to your JDK install path.
instead of opening android sdk manager open android.bat in tools folder. i think it is sdk\tools
You need make sure that:
1) JDK or JRE is installed
2) Within System Variables, the JAVA_HOME variable is set to your JDK/JRE folder (e.g. C:\Program Files\Java\jre7)
3) Your PATH variable includes %JAVA_HOME%\bin

Categories

Resources