Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the real Android Studio Gradle Version?

In (Root) build.gradle Gradle Version is 3.1.3.

(Root) build.gradle

(Root) build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

In project-structure the Gradle version is 4.4

Project-Structure

Enter image description here

Gradle version 4.4

In Gradle-wrapper-properties distributionUrl's, the Gradle version is 4.4

Gradle-Wrapper-Properties

Enter image description here

#Tue Jul 17 17:49:20 KST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

But I can build and I can run the application in the smartphone.

What is the real Gradle version?

like image 794
실버탁 Avatar asked Jul 17 '18 23:07

실버탁


People also ask

Which Gradle version should I use for Android Studio?

If you've updated your Android Studio to 1.3. 2 version then I would suggest using Build Tools Version 23.0. 0 and compile API 23 Android 6.0. As for Gradle Version - 2.4 or higher up to latest 2.7.

What is latest Android Gradle version?

0 (September 2022) Android Gradle plugin 7.3. 0 is a major release that includes a variety of new features and improvements.

What is my current Gradle version?

In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here.

Does Android Studio come Gradle?

Gradle is a build system, which is responsible for code compilation, testing, deployment and conversion of the code into . dex files and hence running the app on the device. As Android Studio comes with Gradle system pre-installed, there is no need to install additional runtime softwares to build our project.


1 Answers

You need to be clear about three things here:

  • Gradle
  • Android Gradle Plugin
  • Gradle Wrapper

Specifically speaking,

  • Gradle is a build tool which evolves independently of Android. Theoretically, Gradle can be used to build any kind of project, for example, a typical Java project, Android Project and even iOS project. It can also be integrated with any kind of IDE, for example, Android Studio, NetBeans, or Eclipse.

    By the time of writing, the latest Gradle version is 4.9, and you can always check its current version from Gradle installation guide. One of the great features of Gradle build tool is it supports Custom Plugins.

  • Android Gradle Plugin The Android Gradle Plugin is one such Gradle custom plugin. For the typical Android project, the version of this plugin can be configured in the top-level build.gradle.

    buildscript {
        ....
            dependencies {
            classpath 'com.android.tools.build:gradle:3.1.3'
        }
        ....
    }
    

    For each version of this plugin, it requires a minimum Gradle version as listed in this page gradle-plugin or see below mapping table for a quick information:

    Enter image description here

    For example, Android Gradle Plugin version 3.1.0+ requires a minimal Gradle version 4.4 which can be configured via Android Studio.

  • Gradle Wrapper. According to the official document Gradle Wrapper

    The recommended way to execute any Gradle build is with the help of the Gradle Wrapper (in short just “Wrapper”). The Wrapper is a script that invokes a declared version of Gradle, downloading it beforehand if necessary. As a result, developers can get up and running with a Gradle project quickly without having to follow manual installation processes saving your company time and money.

    This wrapper can be configured from gradle-wrapper.properties under your project directory. For example,

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
    

    Or from the Android Studio GUI as said in your question:

    Project Structure Configuration.

like image 129
shizhen Avatar answered Oct 20 '22 03:10

shizhen