Parcourir la source

Fix dependency incompatibility

Old config called `Android dependency 'com.android.support:support-v4' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution` error, this PR has fixed this
Folleah il y a 5 ans
Parent
révision
5610ebbafe
No account linked to committer's email address
1 fichiers modifiés avec 10 ajouts et 7 suppressions
  1. 10
    7
      android/build.gradle

+ 10
- 7
android/build.gradle Voir le fichier

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