From 856916e13709d80ba57170b327f3dd26aaaeb664 Mon Sep 17 00:00:00 2001 From: Thahzan Mohomed Date: Wed, 3 Jul 2019 07:53:53 +0530 Subject: [PATCH 1/2] Update build.gradle to accept android tools versions Android tools versions and SDK versions were hardcoded. This will not work when the client application uses different versions. It's recommended to get project wide configurations (if they exist). --- android/build.gradle | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 53a1a73..f9d5372 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,23 +1,25 @@ apply plugin: "com.android.library" +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + android { - compileSdkVersion 25 - buildToolsVersion "25.0.1" + compileSdkVersion safeExtGet('compileSdkVersion', 25) + buildToolsVersion safeExtGet('buildToolsVersion', "25.0.1") defaultConfig { - minSdkVersion 16 - targetSdkVersion 23 - versionCode 1 - versionName "1.0" + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 27) } } dependencies { compile "com.facebook.react:react-native:+" // From node_modules - compile 'com.android.support:customtabs:25.0.1' + compile "com.android.support:customtabs:${safeExtGet('supportLibVersion', '25.0.1')}" compile ('com.github.droibit.customtabslauncher:launcher:1.0.8') { exclude module: 'customtabs' } testCompile 'junit:junit:4.12' -} \ No newline at end of file +} From 8430086be5d5984e0a9ba6d4a5d124bdd46dacf2 Mon Sep 17 00:00:00 2001 From: Thahzan Mohomed Date: Wed, 3 Jul 2019 07:55:58 +0530 Subject: [PATCH 2/2] Replaced deprecated compile statements `compile` is deprecated and will be removed from Gradle 5 --- android/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index f9d5372..d815dca 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -15,11 +15,11 @@ android { } dependencies { - compile "com.facebook.react:react-native:+" // From node_modules - compile "com.android.support:customtabs:${safeExtGet('supportLibVersion', '25.0.1')}" - compile ('com.github.droibit.customtabslauncher:launcher:1.0.8') { + implementation "com.facebook.react:react-native:+" // From node_modules + implementation "com.android.support:customtabs:${safeExtGet('supportLibVersion', '25.0.1')}" + implementation ('com.github.droibit.customtabslauncher:launcher:1.0.8') { exclude module: 'customtabs' } - testCompile 'junit:junit:4.12' + testImplementation 'junit:junit:4.12' }