19

I have been having internet issues, so installing gradle for android studio has been a big issue, so I downloaded the zip file. However, I dont know how to install it offline and set Android studio to use the offline version. I need help.

enter image description here

David Essien
  • 1,463
  • 4
  • 22
  • 36

3 Answers3

27

Now you find your path where your android studio install

then Find .gradle folder, normally gradle is present here...

C:\Users\**YourAccountFolder**\.gradle\wrapper\dists\

Now paste your .zip file in dists folder and Extract.

Now open android Studio Go to

File > Settings > Build, Execute, Deployment > Gradle >

Now in Dialog select Use Local gradle distribution and paste path of your folder where extract .zip file.

then apply and OK

now you can update your gradle(app) And Go to file, setting same as like above path and in dialog SELECT Offline work

Apply and Ok.

Amin Soheyli
  • 605
  • 2
  • 7
  • 16
Ali
  • 3,346
  • 4
  • 21
  • 56
  • 2
    I have done all this android studio is still going online to check for gradle and when I turn off the internet, it comes up with an error. The problem is that even online, the download is never successful – David Essien May 11 '18 at 13:08
  • 2
    your **Service Directory path** is wrong ... @DavidEssien – Ali May 11 '18 at 13:19
  • 3
    set your service directory path like : **home/davldshare/.gradle** @DavidEssien – Ali May 11 '18 at 13:21
  • here is the error it produces: "Gradle sync failed: Could not download gradle-core.jar (com.android.tools.build:gradle-core:3.1.2): No cached version available for offline mode Consult IDE log for more details (Help | Show Log) (46s 480ms)" – David Essien May 11 '18 at 13:57
  • 6
    so Go to the settings and unchecked **Offline Mode** and sync gradle or run project for 1st time if is successfully run then you can go in settings and checked **Offline Mode** @DavidEssien – Ali May 11 '18 at 15:44
  • 3
    Thanks @Mohammad. That's what I'm doing now. Just that internet service here is terrible. It keeps stopping half way. That's why I was particular about offline. I'm hoping it works. – David Essien May 11 '18 at 15:48
  • 1
    look only unchecked offline mode nothing to change other settings @DavidEssien – Ali May 11 '18 at 15:50
18
  • Download gradle zip file
  • Open the gradle-wrapper.properties file from your android project, path specified below

my-app\gradle\wrapper\gradle-wrapper.properties

  • Set the distributionUrl to point to the download zip location, for example

distributionUrl=file:///C:/Users/username/Downloads/Compressed/gradle-4.10.2-all.zip

Done!

Now build the project and Android Studio will install the gradle.

Vivek
  • 11,938
  • 19
  • 92
  • 127
1

In June 2021 im using Android Studio 4.2.1 and I could enable gradle offline mode using the method outlined in the docs below.

Instructions Image

https://developer.android.com/studio/releases#3.6-gradle-offline-ui

Khoudnami
  • 56
  • 4