React Native : Change targeted sdk version for play store upload

In case your current android/app/build.gradle has lines which look like

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

You will have to edit the android/build.gradle to include

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    ...
}

Although I do not know where to get the latest versions.

It would be great if someone could edit this to include where to get the latest version numbers


Open build.gradle under android/app/

find the android { } block

Change the following version to the below:

compileSdkVersion 27
buildToolsVersion "27.0.3"
minSdkVersion 16
targetSdkVersion 27

In the dependencies block, change the appcompat line to match the target version

compile "com.android.support:appcompat-v7:27.1.1"