Gradle and Plugin info for developing error free Android apps in Android Studio

in #android6 years ago (edited)

Hi Steemians,

I would like to update everyone with the updates of developing error free Android apps in Android Studio because many find issues because of plugin/gradle version issues

Set the Android plugin for Gradle to version 3.0.1 from the build.gradle file:

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

Plugin_version.png

Set the Gradle version to 4.1 in gradle-wrapper.properties file:

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

Gradle_version.png

Following is the mapping of Plugin version to Gradle version:

Plugin version         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.2.3          2.14.1 and higher
2.3.0 and higher       3.3 and higher
3.0.0 and higher       4.1 and higher

Android-targeted API level is 27 for Android 8.1 version:

compileSdkVersion 27

If you're using Android plugin for Gradle 3.0.0 or higher, your project automatically uses a default version of the build tools that the plugin specifies. But if you want to use a different version, specify it using buildToolsVersion in your module's build.gradle:

buildToolsVersion '27.0.3'

minSdkVersion value in your app's build.gradle should be at least 14 because a very small percentage of all Android devices are using API levels less than 14:

minSdkVersion 14

targetSdkVersion value in your app's build.gradle should be 27 because the API level is 27 for the latest Platform version of Android 8.1:

targetSdkVersion 14

sdk_version.png

Thanks,
SaAsh Technology

Sort:  

Boost Your Post. Send 0.100 STEEM or SBD and your post url on memo and we will resteem your post on 5000+ followers. check our account to see the follower count.

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.031
BTC 60913.22
ETH 2643.10
USDT 1.00
SBD 2.58