Android studio first run stuck at "Downloading Components" window - android

I have downloaded the latest android studio bundle from android site. Installation was successful, but when I run it for the first time, it shows a window in the screenshot with message "Downloading Android SDK Tools, revision 24.1.2" and then it hangs on infinitely.
When I click on cancel and then show details, the message in attached screenshot appears. This dialog never disappears even on clicking the close button. I have to end it from process manager.
I was wondering if anyone has been able to make it work.

To disable "Downloading Components" at startup,
Go to the installation directory of Android Studio.
There you will find a folder named "bin".
Inside this folder there is a file named "idea.properties".
Open this file and add the following line to the end of the file:
disable.android.first.run=true
What this will do is disable the check that Android Studio performs on first run and decides to download all that stuff.
If it asks to save the file at some different place instead of overwriting the original one, please check the access permissions to the file.

To me it has worked perfectly. You have to download all data for the sdk and can be several GB and can take a long time depending on connection and repositories

If you got stuck earlier and left in middle of download, this may happen
Just go to
C:\Users\Username\AppData\Local\Android
and delete the SDK folder and now try again.

It's actually a bug with the Setup Wizard. See more here
You could try to download the previous stable release: 1.0.2 or 1.0.1.
EDIT
After further testing, apparently if you force close adb the wizard continues normally.

its not stuck. its actually downloading some tools.
if we download like this or through SDK manager.exe the speed is limited.
so it will take much time.
so i tried to open it without internet connection and it showed me some missing tools.
(andoid sdk tool 21.1.1 )
i had 21.1.2 installed but it still showed this. so i manually downloaded it from
internet ( here you will get your max download speed). and placed it with 21.1.2 installation file.
and now it all works.
ps:it was the only file i missed. it won't be the same with everyone

it is a reported bug and I am facing it too in version 1.2.0 see this

Components of the SDK are continuously released and Android Studio's updates aren't very frequent.
You can update the components manually with SDK Manager.
Go to C:\Users\Username\AppData\Local\Android\sdk
Open SDK Manager.exe
Update the packages.
Start Android Studio.

Related

Installation did not complete successfully. see the IDE log for details - Android studio

I am updating my android studio but show me bellow error :
My android studio is 2.3.1
I had the same problem but starting the Android Studio in Administrator Mode has helped me to continue with the update.
The reason is that the SDK manager would write the location of the temp file where it downloads the installer. For example in OP's case its mentioned as below:
in a line form the log or error message
Due to some reason that file might not be available any more and Android studio instead of asking for a re-download would give this error.
The solution to fix this is to find the file .installData from where SDK manager is getting this info and delete it. This will force SDK manager to re download that component only and you don't need to download the complete SDK again
The content of the file looks something like this
#Tue May 16 18:41:10 GST 2017
class=com.android.repository.impl.installer.BasicInstaller
path=C\:\\Users\\user\\AppData\\Local\\Temp\\PackageOperation03
The content and path of the file would be different for different components
I got the same issue on Linux.
It was a permission issue on the SDK installation folder.
In Tools -> Android -> SDK manager there is the SDK installation folder at the top of the window.
Just do a chmod 777 -R on this folder, problem solved.
I had the same problem and i tried to uninstall/install the android studio but that didn't work out for me.
I had recently installed a fresh copy of windows. I'm using windows 10 64bit.
My problem turned out to be permission for the folder that contained the android studio/sdk.
To solve it, I removed old user permissions for user of old windows and added full control for my new user(not sure but i think modify permission would be enough).
To do so, I right click on the folder then selected the security tab.
Then click on Edit
Then click Add in the new screen
my user is named hany so i wrote hany then clicked on Check Names and it choose the right one.Click Ok
the user appears as Users (DESKTOP-8FKNNEM\Users) and then i check the Full control Then Ok
If the user had already existed in the Security tab then it should have permissions that would enable writing
I had this problem before and I tried to uninstall android studio and tried everything but I found the solution..
the solution is :
Download SDK from beginning , and change the SDK path to the new one, then it all will work .. good luck
delete
sdk-root\sources\android-##\.installer\.installData
and
sdk-root\platforms\android-##\.installer\.installData
My solution: (not as complicated as it looks)
Close project and exit Android Studio.
Run Android Studio as Administrator. (Right click on Android's icon will do.)
Android automatically loads a previous project, at exactly where I have left it supposedly.
However, it isn't where I have left it. It is at an earlier project where things (sdk settings/locations) have NOT gone wrong.
Next thing, I open the project I want to work on. A dialogue box appears saying that the Project SDK and Android SDK are pointing to different local folders. Two buttons allow me to choose which SDK location I want to use.
Either one should work!!!
Reflection:
It happens when we switch to a different user but tried to work on the same project.
We should remember to run Android Studio as Administrator unless we have an absolute clear mind about how SDK works.
Make sure you don't have an emulator running when you perform the sdk update. That was my problem that was giving this error.
Check the logs - Menu -> help -> show log in files.
In file explorer sort files by modified time.
Go to end at latest updated file you will find some error written there
In my case, it was "No space left on device".
ide.log location
Help -> Show Log in Explorer
Right click android studio and click run as administrator.. it will work.
It happens some times, you have to re-download it from the beginning with all the files because it seems that the download failed at some point, and then retry
Once I also stuck on that when tried to install emulator via AndroidSDK manager.
The solution is simple.
Right click on your Android sdk home and select sort by time.
And see last modified files.
In my case there were two text files. First file in root folder - ".knownPackages" with text something like: "ÈäUuMá–m ™ŒÝ¼´" and another one in".installdata"with endless text "nullnullnull....". But i forgot its location right now. You can search that in windows explorer.
Then I replaced them to a folder not related to Android home. Sdk re-generated them both after emulator installation.And it started work as it was before
Download Intel XAMP by clicking on this link https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement
After downloading extract this file and install intelhaxm-android.exe file
Problem Solved....
The easiest way I used to fix this issue is to run Android Studio as administrator (Note! My android studio installed on C:/ partition, so this issue caused by permissions)
enter image description here
I found a file ".installData" on the system drive of Windows on advice #dmsherazi. I in this file simply deleted a line in which the path is specified. Then I restarted the Studio and the update fell into place.
solution: install and reinstall Android Studio SDK
or deleting the \instantapps folder in C:\Users\UserName\AppData\Local\Android\Sdk\extras\google\instantapps could be the right solution
Go to "android-sdk" folder. Then go to "ndk-bundle", find and delete ".installData". Come back to Android Studio and goto "Help" and "Check for Updates...". I hope this will work for most of the systems. This problem solved on Android Studio 3.3.2 version.
Make sure that you have the correct access rights to the folder where the sdk is located
If this issue is with Ubuntu please try to start android studio as an administrator privilege by using the command
sudo sh studio.sh
It will resolve this issue.
If you are going for a console command it would be:
chmod -R 777 /www/store. The -R (or --recursive) options make it recursive.
Or if you want to make all the files in the current directory have all permissions type:
chmod -R 777 ./
If you need more info about chmod command see: File permission
First of all you have to show hidden files. then go to this location...
"C:\Users\pc\AppData\Local\Android\Sdk\emulator.installer"
there you will find a file by name ".installData". just delete it.
Come back to Android Studio and goto "Help" and "Check for Updates...". I hope this will work for most of the systems.
Thank me later😎
I had the same problem and I tried to delete sdk-root\.temp directory and it worked for me.
I restarted Android in Administrator mode and it worked for me
Check your internet connection/Change another internet connection and try again.

How to update Android Studio automatically?

I need to Update Android Studio, to the 0.9.9 version, but when I press "Download" (On the update info dialog box) it sends me here:
http://developer.android.com/sdk/index.html
Isn't there a way to make the update happen automatically, because I don't even know how to update it manually.
Also, in the dialog, there is this recommendation:
To configure automatic update settings, see the Updates dialog of your IDE Settings.
The word "Updates" is a link, but it doesn't work.
For this task, I recommend using Android Studio IDE and choose the automatic installation program, and not the compressed file.
On the top menu, select Help -> Check for Update...
Upon the updates dialog below, select Updates link to configure your IDE settings.
For checking updates, my suggestion is to select the Dev channel. I
don't recommend Beta or Canary
channel which is the unstable version and they are not automatic installation, instead a zip file is provided in that case.
When finished with the configuration, select Update and Restart for downloading the installation EXE.
Run the installation.
Warning: Among different version of Android Studio, the steps may be different. But hopefully you get the idea, as I try to be clear on my intentions.
Extra info: If you want, check for Android Studio updates # Android Tools Project Site - Recent Builds. This web page seems to be more accurate than other Android pages about tool updates.
The simplest way to update is as follows:
Go to the start screen for Android Studio. If it automatically opens a project when you open it, close that project (not exit).
At the bottom there will be a check for updates link which you can use to update to the latest version.
There's not always an updater between versions, depending on the version you're starting from and what you're updating to. If that happens, download the full installer and reinstall Android Studio.
Here's the easiest way, as in snapshot,
download the required file and install.
On the startup screen you can use the configure button to check for updates.
1) Choose configure > Check for Update
2) Download the latest updates
Through Android Studio:
Help
Check for latest update
Update
for windows users
go to HELP> CHECK FOR UPDATES>UPDATE(click the link updates)
If you go to help>>check for updates it will tell you if there's an update.
You don't have to change from the stable channel. If you aren't offered an update and restart button, kindly close the window and try again. After about 4 or 5 checks like this, it will eventually show you update and restart button.
Why? because google.
If you are already using Android Studio, you can update via the built in Update mechanism (Check For Updates); make sure you switch to the canary or beta channels if you're not being offered an update.
To configure automatic update settings, see the Updates dialog of your IDE Preferences or settings. You can then switch to either the canary or beta channels. (The default is "stable" but probably that one fails to automatically inform of updates).
Hope it helps. Thanks.
These steps are for the people who already have Android Studio installed on their Windows machine >>>
Steps to download the update:
Google for “Update android studio”
Choose the result from “tools.android.com”
Download the zip file (it’s around 500 MB).
Steps to install Android Studio from a .zip folder:
Open the .zip folder using Windows Explorer.
click on 'Extract all' (or 'Extract all files') option in the ribbon.
Go to the extract location. And then to android-studio\bin and run studio.exe ifyou’re on 32bit OS, or studio64.exe if you’re on 64bit OS.
By then, the Andriod Studio should open and configure your uppdates
I am having a similar problem while updating from 2.3.2 to 2.3.3.
Go to the bin folder of your Android Studio installation folder:
e.g.
cd opt/android-studio/bin
Provide run permission for studio.sh file: chmod +x studio.sh
Run Android Studio from here: ./studio.sh
and try "update and restart" from android studio.
as of AS 1.2+ there is an auto-check for updates which will let you choose between the stable, dev, canary, and beta channels. However it is just a check instead of a full update script. It does require that you click to install and restart your install ( A problem for a remote server situation)
Yes you are right. There is no built in mechanism for automatically updation of Android Studio. You have to manually download it and configure it.
MacOS users
//Manually
Android Studio -> Check for Updates...
//Check Automatically
Android Studio -> Preferences... -> Appearance & Behaviour > System Settings > Updates -> Automatically check updates for <channel>
//Check Now
I think in the new versions of android studio there is no update and restart when you press check for updates from the android studio, so you have to download the newer version from their official website and install it manually. First, you have to change the name of the previous setup version folder for Example Android Studio to Android Studio1, and you can now install the newer version and everything will be the same as before.

Android Studio Not Including SDK

I'm trying to setup Android Studio on a new install of Mac OS X Yosemite. I downloaded the Android Studio Beta v0.8.14 from here: https://developer.android.com/sdk/installing/studio.html and upon launching it complained about not having an SDK (although the download page indicates it should include the SDK). I tried searching after installing for the SDK and can't find it (a few other posts indicate /Applications/Android Studio.app/sdk but that location doesn't exist). Where is the SDK installed and what is required to set it up?
Go to the SDK Manager and click Edit... next to the field for the location of the SDK. Then an "SDK Setup" window should display. There you can download the SDK.
Edit: This answer is deprecated as Android Studio seems to bundle everything since a while already.
Old answer
It seems the android-studio-bundle version is no longer available in the download page (instead there are only android-studio-ide). When you start Android Studio, it won't let you create a new projet until you configure the SDK location.
That means you have to download the SDK separately here, extract it somewhere, and configure it on Configure->Project Defaults->Project Structure. After that, the SDK Manager icon will be enabled and you can download the tools you want.
I had the same problem on Windows. After I re-installed it a few times, I found that the SDK was installed but hidden in C:\Users\<user name>\AppData\Local\Android\sdk.
Information for Windows
For some reason, which I have no time to investigate, Android seems to provide, currently, the IDE and the SDK separately, while in the Dev Webpage says the opposite.
This is the "complete" (false!) tool I have just downloaded: android-studio-ide-171.4443003-windows.exe (SDK is missing here, note the "ide" in the file name).
And this is the real complete tool I had downloaded few months ago, from the same place...: android-studio-bundle-162.3871768-windows.exe
Note that this last one has the "bundle" in the file name.
Please, download the bundle (IDE+SDK) from here:
https://dl.google.com/dl/android/studio/install/2.3.1.0/android-studio-bundle-162.3871768-windows.exe?hl=ko
I want to suppose (¿?) that similar link you can find for Linux or macOS just Googling for it.
Hope this helps!
It worked like this for me
Downloaded the Android Studio
Install Android Studio
Open Android Studio after installation.
You will get a dialog box to import settings if you already have Intellij installed on your machine. Say "Do not Import". Otherwise continue to next step.
It will ask you in the dialog box to pre-configure such as theme, path etc.
Just click next next...and then Finish. You will see the SDK tool will start downloading.
After installation is finished. You can find it in this path: C:\Users\<user name>\AppData\Local\Android\sdk
If you have ever installed Android Studio before and then removed it, it won't reinstall the SDK automatically (speculation: some Windows setting somewhere).
The solution is starting Android Studio and then
File -> Manage IDE Settings -> Restore Default Settings
This will wipe any custom settings you don't have at this point and trigger the SDK install
What Pablo wrote is misleading.
This is the "complete" (false!) tool I have just downloaded:
android-studio-ide-171.4443003-windows.exe (SDK is missing here, note
the "ide" in the file name).
Yes, it is IDE only, but after you install this IDE and first time run it, SDK will be downloaded automatically. So there is no need to download some outdated bundles. Just use default "green button" on https://developer.android.com/studio/index.html
I'm using Ubuntu, and had previously installed Android Studio. It was using too much space, so I deleted it. Now when I downloaded it and started ./studio.sh, it found my previous installation configuration directory and asked to import from there. I did, and then this problem occurred.
I put the directory .Android Studio 3.3 in the trash and restarted ./studio.sh, and it imported the SDK automatically for me. That was good, because I couldn't find it where it was supposed to be according to the dialog box. The 3.3 above is from the version of Android Studio I was installing.
in my case, my country is forbidden from google, and my PC's time zone was set by my counrty.
after I change my timezone to another country my problem solved and android studio download SDK and nkd easily
Re-install studio. If ANDROID_HOME is set to custom location then it will install sdk there else it will install SDK in C:\Users<user name>\AppData\Local\Android\sdk
Note:this is a temporary fix
If you have Eclipse then you can use that SDK for emulation.
Just run the sdk manager and emulate a version of android. Then while you are asking for emulating something ie while running code it will show your emulator as online and you can even use it.
Hope this helps you.
All the Best...

Android-studio Selected directory is not valid home for Android SDK

I installed android studio but while selecting android SDK I am getting following error. I tried solution which is on this post but no luck. How can I solve this?
I had this problem, select SDK folder (NOT SDK->sources or SDK-platforms)
I resolved with the instructions here,
http://www.blog.teamguru.in/2018/04/06/selected-directory-is-not-a-valid-home-for-sdk/
Just close current error window and let run the android studio
Open the SDK manager as shown below
Click on Edit SDK location as shown below
Simply press next button if there is correct location for SDK you want to install there
Let it be downloaded
Install platform and SDK tools and
Enjoy
Try restarting the application. Close all related studio processes, then right click "run as administrator".
You should be fine after this.
I got the same issue. You must enable the Android Support Plugin
Configuration > Plugin > Android Support Plugin. Check it.
Close error window
Go to gradle tab
select "Gradle settings", wrench icon
Search for SDK setup
Select appropriate sdk for your device.
Next, two times
Wait for install
There is all..
None of the other answers work. After the installation, immediately close Android Studio, then start it as administrator. A message might popup asking for the sdk manager location. Ignore it (Close the popup). Go to Tools > SDK Manager and click on the edit button on the right of Android SDK Location. Then click Next, next and you're good to go. Android Studio will let you install the sdk manager.
I had the same problem but what I found is that it requires the parent folder of the following things AVD manager,SDK manager,tools,platform-tools,build-tools etc.So what you need is to find the parent directory of these things, which you might find with a name such as android-sdk or android-sdk-windows(in case you are using windows OS).Make sure the above said contents are in that folder and select it.I hope you will find this useful.
Download the SDK from http://developer.android.com/sdk/index.html
Start SDK manager and make everything up to date
Also, make sure you have set the language level to
7.0 Diamonds, ARM, Multi-catch, etc
I had this problem on Linux. Apparently you need write access to some place in that directory, so I just took ownership of the entire thing:
sudo chown -R thomas:thomas /opt/android-sdk
Could be that something similar is going on on Windows as well.
If like me, a MacOs user which has installed Android Studio on my Mac and if you've tried everything you can think of but was still unable to set the Android SDK directory in Android Studio, follow the next steps (I know the site where I got the bundle is a freeware site but the package is the right one):
1. Download adt-bundle-mac (Android Developer Tools) from [here][1].
2. Unzip the file and browse into the unzipped folder.
3. Copy only the sdk dir to /Users/username/Library/Android
4. Open Android Studio, the error about the SDK folder which is not set will pop up, set the path to the SDK to "/Users/username/Library/Android/sdk".
5. Now Android Studio will accept the path and you're good to go.
I wasted about 2 hours until I fixed it so I hope that by writing this answer I'll save you some 2 hours.
The sdk folder contains the platform-tools folder.
I copied this folder and named it platforms, then it worked for me.
Just delete(preferably permanently) all the android directories in whatever location they are present(e.g. C:\Program Files\Android, C:\users\respective user\respective android folders). Remove the installer as well(if possible). Make sure to save all your Android Studio files in some external storage (preferably).
The main thing is to get Android studio with SDK.
Now go to the android studio website and install android studio leaving all settings default. There you will also get to install the SDK and it's linking.
It will take some time to load and will load nearly 1.5 GB files.
This worked for my case.
In my case I wasn't giving him admin permission
Steps to follow:
Close Android Studio.
Restart Android Studio and Give the path of Empty Folder .
Install Sdk in that folder(Sdk will automatically install and will get configure automatically.)
With Android Studio 4.1.2 the easiest thing is to close the project (file / close project). That's how you get to the wizard that automatically sets up the SDK for you.
The default location that it suggests is /Users/stan/Library/Android/sdk (exactly the same that I was trying to set up manually but AS kept saying it's invalid)

Android SDK Error: Version

I have worked today on a project, which had no errors, and after a sort break, when I re-opened eclipse, I got the following error:
I have tried searching for a solution, but the error is to long in length to find any results.
I even downloaded the new 17 revision, but it didn't help.
So lets start by verifying the current version of ADT installed. Just in case:
Start Eclipse
Click Help
Click "About Eclipse"
Then choose the icon that has the android robot
In the new dialog you will see the ADT version. If this is NOT 17 then the error message does not lie and even though you may have tried to upgrade to version 17 it clearly has not. If it has then I would suggest a complete re-install of ADT and the SDK. You can follow the docs here http://developer.android.com/sdk/eclipse-adt.html#installing
One reason the update may have failed before you start pulling it all apart is that you may need to run eclipse as an administrator. I also find that SDK updates via the SDK manager have to be done as an administrator too.
When going from Eclipse to the SDK Manager I sometimes find that Eclipse has not started it with admin rights even though Eclipse has them. Therefore the update process then fails. I find it best to start the SDK manager with admin rights yourself, and then update the SDK manually and check the error log for any issues (normally the download works but then fails to copy the files for me if I am not in administrator mode).
EDIT/UPDATE:
Have you checked the ADT settings in Eclipse, especially the setting for SDK Location? Does it point to your up to date copy of the SDK? If it is having trouble opening the SDK manager then it could be the SDK is broken after attempting an update. I would uninstall it completely then download a fresh copy.
Restart eclipse after the download.
It shouldn't give you an error

Categories

Resources