Gradle build Details (gradle-wrapper.properties)

Source: Internet
Author: User

Principle: When Android studio opens a project,

    1. first reads the gradle-wrapper.properties file to know which version of Gradle the project requires,
    2. Then will go to save Gradle folder Gradle_user_home to look for the existence of this version of Gradle, does not exist will go to Distributionurl to download.
    3. The reason for the slow opening is that the card downloads the Gradle step, then downloads the Gralde itself and configures it.
      (1). Modify the Gradle-wrapper.properties in the Distributionurl, change to the version we want, only to change the later version on it, the previous part do not change.
      (2). Open the project, this time as will automatically download Gradle and create a good directory. Just kill Android Studio and exit, because this step is to get the download directory created as automatically, navigate to the following directory:
      Windows:c:\users\yonghuming.gradle\wrapper\dists
      Note: Gradle is common, so of course not put Gradle in the project file (not not)
      and then into the corresponding Gradle version folder, you will find a string of garbled folder
      (3) Download Gradle
      from above {your project}/gradle/wrapper/ gradle-wrapper.properties files in the gradle, download the corresponding version of Gradle, download the gradle-2.4-all.zip copy into a string of garbled folder, note do not unzip.
      (4) Turn Android Studio back on, open the project, OK, and open it all at once.
      In addition, it should be noted that the Gradle plug-in and Gradle are two separate things, Gradle plug-in version is determined by the project's outermost build.gradle file
app/build.gradle:buildscript {    repositories {        jcenter()    }    dependencies {        classpath ‘com.android.tools.build: gradle:2.1.0‘        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}

Version of the Gradle plugin.
Select the studio installation directory and enter the directory structure as shown to view the corresponding Gradle plug-in version.
Configure the corresponding version in the corresponding configuration file:
dependencies {
Classpath ' com. android.tools.build:gradle:1.5.0 '
Note:do not place your application dependencies here; They belong
In the individual module Build.gradle files
}
All plug-in versions can be seen in Android-studio\gradle\m2repository\com\android\tools\build\gradle
On the left side of the Project Structure dialog box, select Project
On the right side of the dialog you can see the version of Gradle and the Gradle plugin.
Plugin version ——— Required Gradle version
1.0.0-1.1.3 ——— 2.2.1-2.3
1.2.0-1.3.1 ——— 2.2.1-2.9
1.5.0 ——— 2.2.1-2.13
2.0.0-2.1.2 ——— 2.10-2.13
2.1.3+ ——— 2.14.1+

Gradle build Details (gradle-wrapper.properties)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.