14

I am using Android Studio version 4.1, and behind a proxy. I have already setup Proxy settings and the SDK download works fine.

But when I create a new Project, it's throwing error, like:

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

Where the last line of above (the "Disable...") is blue, like a URL, hence I simply clicked the URL, but then the same error keeps coming.

On searching for "offline" in the settings, I find below snapshot:

Gradle Offline settings not there in the Android Studio Settings

I remember finding Gradle's "offline" mode easily using search in settings (in older Android Studio versions);

Where can these be found in the latest Android Studio???

Top-Master
  • 7,611
  • 5
  • 39
  • 71
Raulp
  • 7,758
  • 20
  • 93
  • 155

5 Answers5

78

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
  • 4,136
  • 5
  • 22
  • 41
Umair Iqbal
  • 1,959
  • 1
  • 19
  • 38
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
  • 30,962
  • 25
  • 85
  • 135
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
  • 2,248
  • 1
  • 19
  • 42
1

Run dependencies.

enter image description here


Now wait for the gradle project sync.

Dharman
  • 30,962
  • 25
  • 85
  • 135
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.