Android Studio SDK Manager downloading into incorrect directory - android

I recently changed my Windows username from myOldName to myNewName. However, when I did that, the SDK Manager is trying to download files to C:\Users\myOldName\..., thus creating an error saying it can't find that directory.
I want to change the download directory for the Android Studio SDK Manager from C:\Users\myOldName to C:\Users\myNewName. How can I do that? Because without changing it I can no longer download anything from the SDK Manager.

Tools-->Android-->SDK Manager,then click the edit button

I had this problem too, go to your SDK directory and look for ".installer" in each of the of problem components (E.G if you cant install/update "platform tools" look for ".installer" in "{your-sdk-directory}/platform-tools/" ). Inside ".installer" you should find ".installData", open with a word editor the change the path to whatever you want, save it, close any file explorers that have your SDK directory open and retry.
Hope this makes sense and is not too late.

Related

Stuck on setup wizard of Android Studio

I am stuck on this screen
Can't perform any further action. Since I already downloaded an SDK, I downloaded this version
Actually android studio try to download all the components of sdk, those which you don't have.
So, it can take a lot time, instead you can 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.
Hope this will help you.
Remove Android Studio settings dirs for re-run Setup Wizard.
I my case I removed both
C:\Users\bieli\.AndroidStudio4.0
and
C:\Users\bieli\.android
Have you specified custom path to SDK in previous step?? if you do not download the SDK you have to go through custom settings and then specify path to SDK. you are also needed to configure the path to SDK in your environment variables, if you are using window system.
What I found reason for this problem, my SDK was corrupted or damaged. My drive were crashed and I have recovered files by recovering tool, that's why files are get damaged and SDK was not working properly.
Then I redownloaded SDK and its running fine.

Android studio first run stuck at "Downloading Components" window

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.

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)

Can´t download Android packages through SDK and AVD Manager any more

That´s the error message:
Downloading Android SDK Platform-tools, revision 8
File not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r08-windows.zip (Access denied)
When i look into my "temp" folder, it´s empty..
What´s the problem here?
Running "SDK Manager.exe" as administrator should solve your problem. That worked for me.
It seems to help to move it to another folder, I just moved the directory C:\Program (x86)\Android to C:\Android.
Using Windows 7 x64.
You should move your directory from C drive.It sometime happened with me so that i changed the Location of Android Sdk & tools because there is a possibility of window crasehd due to some uncertain reason so you will have to download all that Platform tools data again.
I think you should do following thing:
Install updated SDK.exe
Right click on SDK/AVD manager to Run as Administrator for plugins
Hope it may short out your problem.
This is old question but still actual and unconfirmed (unsolved).
SDK Manager creates sdk/temp folder and tries to copy there library archive files. So permissions are problem. You can either change permissions to a sdk folder, move SDK to another location or run SDK manager.exe as administrator.
If one choose the latter option:
Go to \sdk\tools folder, find and run android.bat, which does everything in the safest way (gathers and sets what it needs and run from temp folder). I even don't think that running just SDK_Manager.exe will work.
Permissions are not the Problem. I had the same problem using Windows 8, and I looked into the .bat files to see whats the problem. "android.bat" uses the xcopy command to copy the libraries it uses into the temp folder. But the xcopy command is stored in the System32 folder. Edit android.bat and replace "xcopy" with "C:\Windows\System32\xcopy". That solved it for me, my temp folder did what it was supposed to do, and if I run SDK using the shell, I dont get any errors.
Permission is the problem.
Do this
First Right Click on the Android Sdk Directoory
2.Choose properties
Go To security Tab And click the Edit Button.(you need to be Administrator to do this)
4.Click the Add Button
type "Everyone" in the Enter object Name box And click "Check Names".
Then Click Ok
Now select "everyone" in user names Box And give it Full control in Permissions Box.
Click ok & again Ok to exit.
(: Now you will not need to run SDK Manager as administrator everytime

Android SDK download with Eclipse, getting error message: Failed to create directory C:/

Why does this happen? It doesn't matter which package I pick, always the same error message:
Downloading Android SDK Platform-tools, revision 3
Failed to create directory C:\Program Files\Android\android-sdk\temp
Make sure you have writing permissions for that folder. Try starting Eclipse or the SDK Manager as Administrator.
You only have to run SDK Manager as Administrator, right click and select Run as Administrator.
If you put the Android SDK (or anything else) in Program Files, Windows will, by default, require Admin access to edit files in it. But you can change that by changing the folder permissions:
In Windows, right click on the android SDK folder, click Properties. Go to the Security tab, click Edit to change the permissions. Select normal Users and check the box to Allow Full control.
Then, applications that you launch as a normal user will be able to edit the SDK, such as to update it or compile libraries in it.
Please whether the directory C:\Program Files\Android\android-sdk\temp is already there. If there you see the temp folder then delete the temp folder and try again. It will be installed then.
You can also try installing Android outside of Program Files. I usually put it in C:\Android, then there are no permission issues.
Actually the folder /temp didn't exist for me, so I just created it and then all was fine.
Yes, after that you need to run android SDK as administrator to download the API/platforms.
If anything looks strange (like a list of incomplete names) no worry, close it, and reopen it after 10sec.
Run SDK Manager as Administrator, right click and select run as Administrator. It's one of the amazing things of W7, ;p

Categories

Resources