saashtechnology avatar

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

saashtechnology

Published: 18 Mar 2018 › Updated: 18 Mar 2018Gradle and Plugin info for developing error free Android apps in Android Studio

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

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

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

Written by

Read more #android posts


Best Posts From saashtechnology

We have not curated any of saashtechnology's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From saashtechnology