12

I am on Android 4.1 version and behind the proxy. I have already setup Proxy settings and the sdk download works fine. But when I am creating a new Project it is throwing error :

Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'. Received status code 407 from server: Proxy Authentication Required

Disable Gradle 'offline mode' and sync project

On searching Gradle Offline in the settings , I find below snapshot :

Gradle Offline settings not there in the Android Studio Settings

I simply clicked the url and then error comes "Disable Offline Mode"

What is the difference between the two and where these can be found in the latest Android Studio. I remember finding it easily using search in settings in older Android Studio versions but not this.

Raulp
  • 7,032
  • 15
  • 86
  • 142

5 Answers5

70

If you want to disable/enable Gradle offline mode:

  • Click on the Gradle tab (from the right side of your Android Studio)
  • Select/Unselect the 4th option in the Gradle toolbar.

enter image description here

Ola Ström
  • 2,878
  • 3
  • 18
  • 33
Umair Iqbal
  • 1,765
  • 1
  • 17
  • 34
4

To enable or disable Gradle's offline mode, first select View > Tool Windows > Gradle from the menu bar. Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel..

Head over here for more.

Dharman
  • 26,923
  • 21
  • 73
  • 125
1

Gradle Offline Mode is when Gradle uses the already downloaded dependencies and Gradle Wrapper that are cached on your system.

View Offline Inspection Results is tied to Inspections, nothing to do with Gradle. It is used when you want to run Inspections offline, which I don't think ever matters, since I've never used that setting

Ahmad Sattout
  • 1,755
  • 13
  • 33
1

Run dependencies.

enter image description here


Now wait for the gradle project sync.

Dharman
  • 26,923
  • 21
  • 73
  • 125
1

enter image description here

If we enable Offline Mode, Gradle won't fetch dependencies it will try to fetch from Cache. In Latest Android Studio the option moved to Gradle in dashboard itself.