I\'m using Android Studio. How can I manually install and use Gradle
within Android Studio
.
I\'ve downloaded Gradle
from http
I'm not sure why there are so many contorted descriptions of doing this. Perhaps because Android Studio (AS) is constantly changing/evolving? Nevertheless, the procedure is this simple.
Assuming you have already installed Gradle in a suitable directory, mean that you probably also defined an environment variable for GRADLE_HOME
, if not define it now, and restart AS.
For my example: GRADLE_HOME=C:\Gradle\gradle-5.2.1
Then fire up AS and navigate to:
File > Settings > Build, Execution, Deployment > Gradle
Now, all you need to do is to select: (o) Use local gradle distribution
.
AS will then tell you it found your local Gradle paths:
Hit Apply
and Ok
and restart AS.
Now all the Gradle data can be found in your HOME directory, usually located here (in this case on Windows):
# tree -L 2 $USERPROFILE/.gradle/ | tail -n +2
├── build-scan-data
│ ├── 2.1
│ └── 2.2.1
├── caches
│ ├── 3.5
│ ├── 5.2.1
│ ├── jars-3
│ ├── journal-1
│ ├── modules-2
│ ├── transforms-1
│ ├── transforms-2
│ ├── user-id.txt
│ └── user-id.txt.lock
├── daemon
│ ├── 3.5
│ └── 5.2.1
├── native
│ ├── 25
│ ├── 28
│ └── jansi
├── notifications
│ └── 5.2.1
├── workers
└── wrapper
└── dists
Tested on latest AS 3.3.2
Step 1: Go to the download site from Gradle: https://gradle.org/releases/
Step 2: Extract the downloaded zip file into a directory.
Step 2: Hit Ctrl + Alt + S (mac: ⌘ + ,) in Android studio/Intellij IDEA
Step 3: Goto: Build, Execution, Deployment >> Build Tools >> Gradle (Or just type in the searchbar Gradle)
Step 4: Select: (X) Use local gradle distribution and set Gradle home to your extracted Gradle directory. Click on apply.
Step 5: Get rid of your unnecessary gradle files delete:
- MyApp/gradle/
- gradlew
- gradlew.bat
Unpack it where ever you like. In Android Studio under Settings is category Gradle where you can specify external gradle location if you want. It probably makes sense to put gradle bin folder into your path.
Follow these steps
This is what worked for me. I hope it helps.
in first step you should go to http://www.gradle.org/downloads and then choose your Gradle version and follow download link in GitHub and then download Gradle from GitHub. after your download is completed, you should extract the downloaded file in a directory (every directory that you want). finally open extracted folder and just run gradlew.bat and wait several minutes for completing download. and after completing download files, Gradle install itself automaticly. Gradle will work correctly for next times. i resolve this problem with this way and i tested it and every things are ok, so every one can test this way, it should working well. Good Luck.
I used like this,
distributionUrl=file\:///E\:/Android/Gradle/gradle-5.4.1-all.zip
And its worked for me.