From 5173014594d7c475f26334662a9859ec2ab9f78a Mon Sep 17 00:00:00 2001 From: Firoz Ahmed Date: Wed, 28 Aug 2019 11:44:18 +0530 Subject: [PATCH] Update build.gradle --- android/build.gradle | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e43f8bd2..99a7a019 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,31 +1,38 @@ +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath("com.android.tools.build:gradle:3.4.1") + } +} + apply plugin: 'com.android.library' -def DEFAULT_COMPILE_SDK_VERSION = 23 -def DEFAULT_BUILD_TOOLS_VERSION = "23.0.2" -def DEFAULT_TARGET_SDK_VERSION = 23 -def DEFAULT_SUPPORT_LIB_VERSION = "23.1.0" +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} android { - compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION - buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION + compileSdkVersion safeExtGet('compileSdkVersion', 28) + buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3') defaultConfig { - minSdkVersion 16 - targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 28) versionCode 1 versionName "1.0" } - buildTypes { - release { - minifyEnabled false - } + lintOptions { + abortOnError false } } -def supportVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION +def supportVersion = safeExtGet('supportLibVersion', '28.0.0') dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.android.support:appcompat-v7:${supportVersion}' - compile 'com.facebook.react:react-native:+' + implementation "com.android.support:appcompat-v7:${supportVersion}" + implementation 'com.facebook.react:react-native:+' }