Pro Your skills of Gradle use in Android Studio


Types of Gradle and use of its properties


Download 323.31 Kb.
bet3/5
Sana18.06.2023
Hajmi323.31 Kb.
#1578235
1   2   3   4   5
Types of Gradle and use of its properties
Now lets start each point in details, it provides basic information about types of gradle.
build.gradle

  • Their are two types of build.gradle one is project and other is module level.

Project level gradle

  • We rarely deal with project level gradle it is a Top-level build file where you can add configuration options common to all modules.

ext {
// sdk and tools
minSdkVersion = 14
targetSdkVersion = 22
compileSdkVersion = 26
buildToolsVersion = '26.0.2'
// dependencies versions
supportLibraryVersion = '27.0.0'
playServicesVersion = '11.4.2'
versionCode= 12
versionName= "1.74"
butterknife="8.8.1"
retrofit="2.0.2"
okhttp="3.7.0"
dragger="2.12"
}

  • You have definitely used ut when you want to add google-play-services or Realm database like

buildscript {
repositories {
jcenter {
url "http://jcenter.bintray.com"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath "io.realm:realm-gradle-plugin:4.1.1"
classpath 'com.google.gms:google-services:3.0.0'

}
}
Module level gradle
Module level gradle is mostly updated section in the application which is almost the heart of the application. A minor error spoils your project build time. Some commonly used features of this gradle file
Some of the properties of module level gradle dexOptions, signingConfigs, defaultConfig, lintOptions, buildTypes, productFlavors
dexOptions: If you get an dexError in your project this is the part to keep you out from issue


DexOptions - Android Plugin 3.0.0-dev DSL Reference
This is enabled by default and works around an issue that will cause the app to crash when using java.lang.reflect…
google.github.io



Download 323.31 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling