22

I am updating my android studio but show me bellow error :

enter image description here

My android studio is 2.3.1

26 Answers26

28

I had the same problem but starting the Android Studio in Administrator Mode has helped me to continue with the update.

rollstuhlfahrer
  • 3,988
  • 9
  • 25
  • 38
Coder Absolute
  • 5,417
  • 5
  • 26
  • 41
10

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

dmSherazi
  • 3,743
  • 5
  • 37
  • 62
  • 1
    This works for me. Just fin the `.installData` file and delete :) – Blues Clues Jul 10 '18 at 11:00
  • worked for me.. followed the paths (which uses ; instead of . ) in the error message to find and delete the installData files and voila.. all is good – Kent Lauridsen Oct 03 '18 at 00:07
  • there is no such file as `.installData` in my sdk path `C:\Android\android-sdk` – user924 Jun 01 '19 at 15:32
  • 1
    @user924 can you share the error messages that you get? By the way, it is usually inside `sdk-root\sources\android-##\.installer\.installData` and `sdk-root\platforms\android-##\.installer\.installData` – dmSherazi Jun 11 '19 at 06:37
7

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.

Laurent
  • 1,661
  • 16
  • 29
5

delete

sdk-root\sources\android-##\.installer\.installData

and

sdk-root\platforms\android-##\.installer\.installData

Cser Soft
  • 51
  • 2
5

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. enter image description here

Then click on Edit

Then click Add in the new screen

enter image description here

my user is named hany so i wrote hany then clicked on Check Names and it choose the right one.Click Ok

enter image description here

the user appears as Users (DESKTOP-8FKNNEM\Users) and then i check the Full control Then Ok

enter image description here

If the user had already existed in the Security tab then it should have permissions that would enable writing

user3814327
  • 111
  • 1
  • 4
4

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

Hesham Morsy
  • 433
  • 3
  • 13
  • Could you please add more detail to your answer? – Herii Aug 24 '21 at 02:31
  • @JohnHarris can you please tell me what do you want to understand? – Hesham Morsy Aug 24 '21 at 11:05
  • When you wrote: "Downloaded SDK from beginning" what did you mean? From the initial IDE setup? from the internet? Before installing the IDE? and then you say to change the sdk path. Where? in the IDE? In the OS? where?. Your instructions are unclear, for many of us its clear but not to everyone. I don't even know why this answer was accepted, there are even others with a lot more upvotes. – Herii Aug 24 '21 at 15:33
  • @JohnHarris when I faced this problem, non of these other upvoted answers worked with me, and I wrote the solution that worked with me. and it looks it worked with the one who asked the question, that's why he put this answer as accepted! – Hesham Morsy Aug 30 '21 at 18:29
  • @JohnHarris about your questions, first I meant downloading the SDK from the beginning from the internet, second, the problem was happening when we were trying to update android studio, so the android studio is already installed but can't be updated, third, change the SDK path in the IDE. If this is the same situation happening with you, I hope it's clear now. – Hesham Morsy Aug 30 '21 at 18:36
3

ide.log location

Help -> Show Log in Explorer

Richard Chan
  • 118
  • 2
  • 12
3

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.
W Stevie
  • 31
  • 2
2

Make sure you don't have an emulator running when you perform the sdk update. That was my problem that was giving this error.

NathanH
  • 154
  • 1
  • 10
  • it was my problem. After closing running emulator, the new android emulator is installed without any issues. – Siva Oct 09 '21 at 04:52
1
  1. Check the logs - Menu -> help -> show log in files.
  2. In file explorer sort files by modified time.
  3. Go to end at latest updated file you will find some error written there

In my case, it was "No space left on device".

user3024215
  • 196
  • 1
  • 7
1

Right click android studio and click run as administrator.. it will work.

FARAH
  • 19
  • 2
0

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

DDragos
  • 360
  • 3
  • 9
0

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

CodeToLife
  • 3,672
  • 2
  • 41
  • 29
0

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 enter image description here After downloading extract this file and install intelhaxm-android.exe file Problem Solved....

Satyam Mishra
  • 136
  • 1
  • 8
  • 1
    A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) – LW001 Nov 16 '17 at 15:33
0

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

M. H.
  • 960
  • 11
  • 13
0

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.

0

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

BIS Tech
  • 17,000
  • 12
  • 99
  • 148
0

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.

UTSAB SEN
  • 1
  • 1
  • 1
0

Make sure that you have the correct access rights to the folder where the sdk is located

Aerim
  • 1,960
  • 3
  • 16
  • 28
0

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.

Mohit Dholakia
  • 252
  • 2
  • 16
0

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

Rehan Sarwar
  • 994
  • 8
  • 20
0

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

0

I had the same problem and I tried to delete sdk-root\.temp directory and it worked for me.

Krupa Kakkad
  • 857
  • 1
  • 13
  • 28
0

I restarted Android in Administrator mode and it worked for me

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 07 '22 at 03:13
0

The solution that worked for me is to remove the token in github From Android Studio settings Then I reinstalled again, and it workedenter image description here

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 12 '23 at 13:06
-1

Check your internet connection/Change another internet connection and try again.

Thào A Vảng
  • 397
  • 4
  • 7