Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native : Change targeted sdk version for play store upload

In Play Store I am trying to upload my app but I'm getting a warning i.e. mentioned below:

Target API level requirements from August 2018

Warning:

Your app currently targets API level 22 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance.

From August 2018, new apps must target at least Android 8.0 (API level 26). From November 2018, app updates must target Android 8.0 (API level 26).

like image 380
Sadhu Avatar asked May 16 '18 10:05

Sadhu


People also ask

How do I change my target SDK?

Step 1: Open your project in Android mode then go to Gradle Scripts > build. gradle(Module: app) as shown in the following image. Step 2: Refer to the below image and here you have to change the minSdkVersion and targetSdkVersion as per the requirement.

How do you update targetSdkVersion in React Native?

To do so open android/build. gradle in your React Native project and then increment the compileSdkVersion and targetSdkVersion values to 29 . buildscript { ext { buildToolsVersion = "28.0. 3" minSdkVersion = 16 compileSdkVersion = 29 targetSdkVersion = 29 } // ... }

How do you change minSdkVersion in React Native?

You can see it here on their official build. gradle file: android { compileSdkVersion 28 ... defaultConfig { minSdkVersion(16) targetSdkVersion(28) versionCode(1) versionName("1.0") } ... } By setting minSdkVersion to 16 , react-native uses Android API's natively supported by at least KitKat version.


1 Answers

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" 
like image 125
Albert Gao Avatar answered Sep 22 '22 08:09

Albert Gao