Error with SDK package download in Android Studio

2020-05-21 06:34发布

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

13条回答
Ridiculous、
2楼-- · 2020-05-21 06:42

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.

查看更多
该账号已被封号
3楼-- · 2020-05-21 06:44

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

查看更多
干净又极端
4楼-- · 2020-05-21 06:46

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楼-- · 2020-05-21 06:49

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.

查看更多
Summer. ? 凉城
6楼-- · 2020-05-21 06:49

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

查看更多
放我归山
7楼-- · 2020-05-21 06:50

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

查看更多
登录 后发表回答