From 6883e07e9f35c255ce01cc1bb79585e4103476e2 Mon Sep 17 00:00:00 2001 From: Juan David Nicholls Cardona Date: Thu, 28 Feb 2019 17:06:53 -0500 Subject: [PATCH 1/2] Support other Android versions --- android/build.gradle | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 3faae89..afdf4d8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,3 +1,4 @@ +apply plugin: 'com.android.library' buildscript { repositories { @@ -9,15 +10,22 @@ buildscript { } } -apply plugin: 'com.android.library' +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + +def DEFAULT_COMPILE_SDK_VERSION = 23 +def DEFAULT_BUILD_TOOLS_VERSION = "23.0.1" +def DEFAULT_MIN_SDK_VERSION = 16 +def DEFAULT_TARGET_SDK_VERSION = 22 android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) + buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) defaultConfig { - minSdkVersion 16 - targetSdkVersion 22 + minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) + targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) versionCode 1 versionName "1.0" } From 4386eecbe8be6a433f76e82c249fcd12c29d86a0 Mon Sep 17 00:00:00 2001 From: Juan David Nicholls Cardona Date: Thu, 28 Feb 2019 22:57:38 -0500 Subject: [PATCH 2/2] Update build.gradle --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index afdf4d8..52caca9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -39,5 +39,5 @@ repositories { } dependencies { - compile 'com.facebook.react:react-native:+' + implementation 'com.facebook.react:react-native:+' }