问题
I use Android Studio version 1.5.1, and I'm trying to compile 'com.android.volley:volley:1.0.0' in build.gradle, but I can't sync Gradle. I think this error is because of my Internet connection or access being blocked from my country (Iran).
回答1:
Yes, it's because Google has been blocked in Iran since 2012. You can use a proxy app like Shadowsocks to change your country.
After activating your proxy app, in Android Studio go to file->setting->Appearance & Behavior->System Setting->HTTP Proxy active 'Manual proxy configuration'
and set:
- host name:127.0.0.1 (for example)
- port name:1080 (for example)
and reset Android Studio. When Android Studio resets, activate the HTTPS proxy and sync your Gradle and it will work. ;)
回答2:
you have to install any connect and set cisco username and password and restart android studio
来源:https://stackoverflow.com/questions/39686832/cant-sync-gradle-in-android-studio-in-iran