Browse Source

Merge pull request #199 from Folleah/patch-1

Fix dependency incompatibility
Gaëtan Renaudeau 5 years ago
parent
commit
4a01cbf1d4
No account linked to committer's email address
1 changed files with 10 additions and 7 deletions
  1. 10
    7
      android/build.gradle

+ 10
- 7
android/build.gradle View File

1
+def safeExtGet(prop, fallback) {
2
+    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3
+}
4
+
1
 buildscript {
5
 buildscript {
2
     /* In case of submodule usage, do not try to apply own repositories and plugins,
6
     /* In case of submodule usage, do not try to apply own repositories and plugins,
3
         root project is responsible for that. */
7
         root project is responsible for that. */
15
 apply plugin: 'com.android.library'
19
 apply plugin: 'com.android.library'
16
 
20
 
17
 android {
21
 android {
18
-    compileSdkVersion 27
19
-    buildToolsVersion "28.0.3"
22
+    compileSdkVersion safeExtGet('compileSdkVersion', 27)
23
+    buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
20
 
24
 
21
     defaultConfig {
25
     defaultConfig {
22
-        minSdkVersion 16
23
-        targetSdkVersion 27
26
+        minSdkVersion safeExtGet('minSdkVersion', 16)
27
+        targetSdkVersion safeExtGet('targetSdkVersion', 27)
24
 
28
 
25
         versionCode 1
29
         versionCode 1
26
         versionName "1.0"
30
         versionName "1.0"
42
 }
46
 }
43
 
47
 
44
 dependencies {
48
 dependencies {
45
-    implementation 'com.android.support:support-v4:27.+'
46
-
49
+    implementation "com.android.support:support-v4:${safeExtGet('supportLibVersion', '27.+')}"
47
     api 'com.facebook.react:react-native:+'
50
     api 'com.facebook.react:react-native:+'
48
-}
51
+}