Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't sync Gradle in Android Studio in Iran

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

like image 434
Babak no'doust Avatar asked Sep 25 '16 12:09

Babak no'doust


People also ask

Why is Gradle not syncing?

Check your Internet Connectivity. Gradle Sync requires a stable internet connection for downloading various versions required for the project online. Hence it is always advised to check your internet connection before syncing your project in Android Studio.

How do I sync Gradle with Android studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.


1 Answers

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

like image 118
Babak no'doust Avatar answered Sep 28 '22 01:09

Babak no'doust