Error with SDK package download in Android Studio

淺唱寂寞╮ 提交于 2020-05-09 19:11:27

问题


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


回答1:


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.




回答2:


delete uncompleted download in "\Sdk.downloadIntermediates". i solved my problem by this method.




回答3:


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




回答4:


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.




回答5:


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.




回答6:


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.




回答7:


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




回答8:


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:




回答9:


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).




回答10:


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.




回答11:


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



回答12:


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




回答13:


instalacion offline de complementos de Android Studio 3.6.3 en macos Catalina. primeramente se deben de identificar la ruta de ubicacion de las carpetas:

SDK: /Users//Library/Android/sdk

JDK: /Application/Android Studio.app/Contents/jre/jdk/Contents/Home Aqui se debe de configurar la variable JAVA_HOME

identificar los componentes SDK requeridos:

1- Android Emulator 266MB

https://dl.google.com/android/repository/emulator-darwin-6306047.zip

descomprimir en la carpeta /Users//Library/Android/sdk/emulator

2- Android SDK Buil-Tools 29.0.3 50MB

https://dl.google.com/android/repository/build-tools_r29.0.3-macosx.zip

descomprimir en la carpeta /Users//Library/Android/sdk/build-tools/29.0.3

3- Android SDK Plataform 29 74.6MB

https://dl.google.com/android/repository/platform-29_r04.zip

descomprimir en la carpeta /Users//Library/Android/sdk/platforms/android-29

4- SDK Patch Applier v4 1.74MB

https://dl.google.com/android/repository/3534162-studio.sdk-patcher.zip

descomprimir en la carpeta /Users//Library/Android/sdk/patcher/v4

5- Source for Android 29 37.6MB

https://dl.google.com/android/repository/sources-29_r01.zip

descomprimir en la carpea /Users//Library/Android/sdk/sources/android-29

.........

Parsing /Users/yairmamani/Library/Android/sdk/build-tools/29.0.3/package.xml

Parsing /Users/yairmamani/Library/Android/sdk/emulator/package.xml

Parsing /Users/yairmamani/Library/Android/sdk/extras/inte/Hardware_Accelerated_Execution_Manager/package.xml

Parsing /Users/yairmamani/Library/Android/sdk/patcher/v4/package.xml

Parsing /Users/yairmamani/Library/Android/sdk/platform-tools/package.xml

Parsing /Users/yairmamani/Library/Android/sdk/platforms/android-29/package.xml

Parsing /Users/yairmamani/Library/Android/sdk/sources/android-29/package.xml

Android SDK is up to date.



来源:https://stackoverflow.com/questions/43705311/error-with-sdk-package-download-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!