Swati
Swati

Reputation: 473

Error with SDK package download in Android Studio

java.io.IOException: Cannot download , response: 200 OK Warning: An error occurred while preparing SDK package Android Support Repository: Cannot download , response: 200 OK. java.io.IOException: Cannot download 'https://dl.google.com/android/repository/emulator-windows-3833124.zip': dl.google.com Warning: An error occurred while preparing SDK package Android Emulator: Cannot download 'https://dl.google.com/android/repository/emulator-windows-3833124.zip': dl.google.com. java.io.IOException: Cannot download ' Warning: An error occurred while preparing SDK package Google Repository: Cannot download

Upvotes: 44

Views: 177136

Answers (18)

Asraful Haque
Asraful Haque

Reputation: 1125

Same problem happened to me. After two days constant trying I solved the problem. I use internet from my mobile using JIO SIM. I just switched my alternate mobile for internet data where I am also using VODAFONE SIM. You just switch from your current internet to another internet even over WIFI. I see in some cases some websites does not work properly in Jio network otherwise I prefer this network(JIO) for its top-notch speed and services. If in your case whatever your data provider just try this method use other data provider or WIFI. If this method solves your problem just hit the like button so others can get help. Thanks

Upvotes: -1

Ecclesiaste Panda
Ecclesiaste Panda

Reputation: 427

Simply click on menu: File then click ->Invalidate caches

You may need to check optional if available

(clear file system cache and local history)

(clear vcs log cache and indexes)

Then click Invalidate and Restart.

This will solve your problem.

Thanks

Upvotes: -1

Ashan Priyadarshana
Ashan Priyadarshana

Reputation: 3619

I did not had android studio and was using only sdk manager. It was downloading to a location of <your path>\Android\.temp Directory.

Deleted the broken .zip file and re-ran the flutter run command.

Upvotes: 0

Abhijit Bangde
Abhijit Bangde

Reputation: 81

As mentioned in the earlier comments, the problem might be because of slow internet connection, just to add more details, you need to download all the problematic file which you get in the logs, in my case they were (emulator-windows_x<>.zip and x86-30_r09.zip) and place them in the respective sub-folders (PackageOperation02 or PackageOperation05 ..) present in .tmp folder located under andriod-sdk root folder and retrigger the sdk installation from Andriod studio.

What Andriod-Studio will do after your action: It will first search the files in .tmp folder if they exist it wont download and simply unzip and initiate the installation from where it failed.

Upvotes: 0

Prem Naik
Prem Naik

Reputation: 471

delete uncompleted download in "[Android SDK folder]\.downloadIntermediates". i solved my problem by this method.

Upvotes: 47

Very often the cause of errors can be an interruption of the Internet connection. Just resume downloading with stable Internet.

Upvotes: 1

Benyamin
Benyamin

Reputation: 1144

This amount of download requires high speed Internet and if you don't have this it may show this error.

Upvotes: 0

Below steps fixed the problem for me -

1. Download zip file from this location
2. Extract it and move the emulator folder image for emulator folder into the SDK folder image for SDK folder

I hope it works for you as well, I was using Windows 10 Pro 64bit

Upvotes: 0

leoo
leoo

Reputation: 61

you can manual download sdk:

  1. https://dl.google.com/android/repository/platform-29_r04.zip
  2. https://dl.google.com/android/repository/3534162-studio.sdk-patcher.zip
  3. https://dl.google.com/android/repository/build-tools_r29.0.3-windows.zip
  4. https://dl.google.com/android/repository/emulator-windows-6306047.zip
  5. https://dl.google.com/android/repository/sources-29_r01.zip
  6. https://dl.google.com/android/repository/platform-tools_r29.0.6-windows.zip

Unpack to

  1. C:\Android\Sdk\platforms\android-2
  2. C:\Android\Sdk\patcher\v4
  3. C:\Android\Sdk\build-tools\29.0.3
  4. C:\Android\Sdk\emulator
  5. C:\Android\Sdk\sources\android-29
  6. C:\Android\Sdk\platform-tools

Parsing

  1. C:\Android\Sdk\build-tools\29.0.3\package.xml
  2. C:\Android\Sdk\emulator\package.xml
  3. C:\Android\Sdk\patcher\v4\package.xml
  4. C:\Android\Sdk\platform-tools\package.xml
  5. C:\Android\Sdk\platforms\android-29\package.xml
  6. C:\Android\Sdk\sources\android-29\package.xml

Upvotes: 6

Samir Alakbarov
Samir Alakbarov

Reputation: 1145

Find Android SDK folder. (Usually C:\User\AppData\Local\Android\sdk) Delete folders which starts with dot(.), they are temporary download files. Then delete Android Emulator from SDK Manager. Then run Android Studio as administrator and then download and install Android Emulator again. Now you can create emulator and use it without errors.

Upvotes: 2

Matthew the Coder
Matthew the Coder

Reputation: 57

I had a similar issue while installing in Mac Catalina:

java.net.SocketException: Operation timed out (Read failed) Warning: An error occurred while preparing SDK package Sources for Android 29: Operation timed out (Read failed).

First attempt using standard configuration - Failed
Second attempt using standard configuration - Failed
Third attempt using Customer configuration, I selected the android simulator - Failed
Fourth attempt using Customer configuration, I selected the android simulator - Successful!

Not sure what was the reason, there is no change in any setting other than the above (and I am an Administrator of the Mac).

Upvotes: 0

sadam sidiq
sadam sidiq

Reputation: 61

I have a similar problem.

And I notice some setting about Force https//... to be fetched using http://...

After using it, my download run normally:

enter image description here

Upvotes: 6

Hemant Varhekar
Hemant Varhekar

Reputation: 42

Hi I faced a similar issue... Turn's out that may be related to system configuration of your machine..

Try downloading latest packages as per your system configuration from below:

https://developer.android.com/studio/?gclid=Cj0KCQjwj9LkBRDnARIsAGQ-hUfGD0_yGXcqqZBN6d1Y-nMZ-TNKZtvdRBHimcE8m0tPYjyUw_bV77AaAsdzEALw_wcB

Upvotes: 0

Sandro Tsagareli
Sandro Tsagareli

Reputation: 1

I had the same problem, I downloaded problematic file 'https://dl.google.com/android/repository/emulator-windows-3833124.zip' and extracted it to C:\Users\$usrname$\AppData\Local\Android\sdk\extras\android. It solved the problem for me.

Upvotes: 0

NRK Rao
NRK Rao

Reputation: 62

I had Admin access on my Laptop, but still I faced this problem (also other packages were getting downloaded). I found of that the https://dl.google.com/android/repository/android_m2repository_r47.zip file is quiet large, and in my case since my network speed was slow and I was attempting to download a large file on a slow network I concluded that it was failing for timeout. I switched to a faster LAN and it got downloaded.

Upvotes: 0

Jerome Joseph
Jerome Joseph

Reputation: 29

run the studio.sh script with sudo:

"sudo ./studio.sh"

if that does not work run:

"sudo chmod 777 -R /opt"

without quotes should work

Upvotes: 2

puchu
puchu

Reputation: 11

As shown in the android SDK video ./studio.sh has to be run, however if run without sudo or su, this might give problems like these. So you should run with sudo or su as shown below:

  • sudo ./studio.sh(or /path/to/studio.sh)

or if you want to run as root

  • su
  • Password:root password
  • ./studio.sh or (or /path/to/studio.sh) This should fix the problem There might be a problem with /tmp if it is on a different partition and the partition has less space than needed to install

Hope this helps.

Upvotes: 0

user7940775
user7940775

Reputation:

I had this similar issue below worked for me. The solution for this is:

  1. Run Android Studio as Administrator.

  2. Re run the update.

It will work.

Upvotes: 79

Related Questions