有个VIVO的android手机,Android系统是5.x的版本,插上后,Android Studio需要去下载对应的SDK:
All packages are not available for download
the following packages are not available
package id platform android-22
2017/11/3 13:46 Instant Run is disabled: Instant Run requires that the Android SDK for the API level of the device you are deploying to is installed. To use Instant Run, open SDK Manager and install the missing platform. (Don’t show again) 13:46 Executing tasks: [:app:assembleDebug] |
All packages are not available for download the following packages are not available
package id platform android-22
Package id platform: android-O not available – Stack Overflow
Instant run issue on Android Studio 2.2 – Stack Overflow
Android Studio AVD Manager cannot update system images – Stack Overflow
Android Studio 2.2.2: All packages are not available for download – Stack Overflow
All packages are not available for download error in android – Stack Overflow
去试试:
Check Now,结果:
android studio connection failed(connect timed out)
期间去试了多种方法组合:
参考:
Android Studio 自动更新失败解决办法 – 脉脉不得语的技术博客
Android studio check for updates failed – 简书
完全解决!android studio更新 check for updates失败的问题 – CSDN博客
更新 IDE 和 SDK 工具 | Android Studio
期间:
确认了此处的hosts中,并没有Google的配置
然后再去下载就正常了:
就可以正常下载了。
解决了问题后,再去看看:
配置 Android Studio | Android Studio
【总结】
最终结论是:
对于(很多的)google的地址,比如:
https://dl.google.com/android/repository/android-22_r02.zip
江苏电信的网络:
- 无法直接打开
- 需要翻墙才能下载
- 且即使是翻墙后,下载速度也很慢,比如只有几十KB/s
而手机的网络则:
- 可以直接打开google的地址
- 且下载速度爆快:几MB/s
注:此处是让电脑端用中国移动的GPRS信号的手机分享出来的WI-FI网络
之所以江苏电信无法打开(很多)google地址,则是之前自己在:
就知道的问题。
所以对于电脑端用江苏电信的前提下,只能去配置Android Studio 3:
1.修改Http Proxy为Auto-detect proxy settings
去Android Studio 3 -》 Tools-》Android -》SDK Manager-》Appearance & Behavior -》System Settings -> Http Proxy
从
No Proxy
改为:
Auto-detect proxy settings
注:去试试Check connection
输入你要测试的地址,比如:
https://dl.google.com/android/repository/android-22_r02.zip
https://dl.google.com/android/repository/extras/intel/addon2-1.xml
应该就可以连接成功了。
2.设置vmoptions的update url
去修改:
android studio\bin
下面的:
studio.exe.vmoptions
studio64.exe.vmoptions
去在最底部加上配置:
-Djava.net.preferIPv4Stack=true -Didea.updates.url=https://dl.google.com/android/studio/patches/updates.xml |
注:
1.http的地址:
-Djava.net.preferIPv4Stack=true -Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml |
是不行的。
2.修改vmoptions后,需要重启Android Studio才能生效。