Method for Android studio to manually configure gradle

Gradle is a project automation construction tool based on the concepts of Apache ant and Apache Maven. It uses a groovy based domain specific language (DSL) to declare project settings, abandoning the cumbersome configuration based on XML. Mainly for Java applications. Currently, its supported languages are limited to Java, groovy and Scala, and it is planned to support more languages in the future.

Here are some features of gradle

Why use groovy?

The complete gradle API is designed using the groovy language. This is the advantage of XML based internal DSL. Gradle is its core general construction tool; Its main focus is java projects. In these projects, team members should be familiar with Java in order to better build projects that are transparent to all team members.

Similar to python, groovy or ruby is the best build framework. Why was groovy chosen? This is because it provides the greatest transparency so far for people who use Java. The basic syntax of groovy is the same as that of Java.

1 question

(1) What if Android sutdio opens a project for the first time?

(2) Why is manual configuration of gradle home always invalid?

(3) Mingming has downloaded gradle and configured gradle home. Why open the project or download gradle automatically?

2 Introduction

(1) How does Android studio know which gradle to use?

The gradle used in an as project is determined by the following document in our project:

The distributionurl in the last row determines the gradle version used by this project, that is, different projects can use different gradle versions, which is why modifying gradle home fails. So how do we know which versions of gradle are available? answer

Gradle download address: https://services.gradle.org/distributions/

(2) Where is gradle kept?

Gradle is shared by everyone. Of course, gradle will not be placed in the project file (not impossible). As saves gradle in the following directory:

After entering the corresponding gradle folder, you will find a string of garbled folders. Here, take gradle-2.4-all as an example

Open this folder and you will find two files below

Download the corresponding gradle version file and put it in the folder with a string of garbled codes. Be careful not to unzip it. Delete the gradle-2.4-all.zip.part file

Then restart Android studio

summary

The above is the method of manually configuring gradle in Android studio introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>