@@ -5,7 +5,7 @@ buildscript {
5
5
}
6
6
7
7
dependencies {
8
- classpath ' com.android.tools.build:gradle:3.3 .2'
8
+ classpath ' com.android.tools.build:gradle:3.4 .2'
9
9
}
10
10
}
11
11
@@ -40,10 +40,18 @@ repositories {
40
40
}
41
41
42
42
dependencies {
43
+ // Use either AndroidX library names or old/support library names based on major version of support lib
44
+ def supportLibVersion = safeExtGet(' supportLibVersion' , ' 28.0.0' )
45
+ def supportLibMajorVersion = supportLibVersion. split(' \\ .' )[0 ] as int
46
+ def appCompatLibName = (supportLibMajorVersion < 20 ) ? " androidx.appcompat:appcompat" : " com.android.support:appcompat-v7"
47
+ def supportV4LibName = (supportLibMajorVersion < 20 ) ? " androidx.legacy:legacy-support-v4" : " com.android.support:support-v4"
48
+ def supportV4Version = safeExtGet(' supportV4Version' , safeExtGet(' supportLibVersion' , ' 28.0.0' ))
49
+ def mediaCompatLibName = (supportLibMajorVersion < 20 ) ? " androidx.media:media" : " com.android.support:support-media-compat"
50
+ def mediaCompatVersion = safeExtGet(' mediaCompatVersion' , safeExtGet(' supportLibVersion' , ' 28.0.0' ))
51
+
43
52
implementation " com.facebook.react:react-native:${ safeExtGet('reactNativeVersion', '+')} "
44
53
implementation " com.google.android.gms:play-services-gcm:${ safeExtGet('googlePlayServicesVersion', '16.1.0')} "
45
- // noinspection GradleCompatible
46
- implementation " com.android.support:appcompat-v7:${ safeExtGet('supportLibVersion', '28.0.0')} "
47
- implementation " com.android.support:support-v4:${ safeExtGet('supportLibVersion', '28.0.0')} "
48
- implementation " com.android.support:support-media-compat:${ safeExtGet('supportLibVersion', '28.0.0')} "
54
+ implementation " $appCompatLibName :$supportLibVersion "
55
+ implementation " $supportV4LibName :$supportV4Version "
56
+ implementation " $mediaCompatLibName :$mediaCompatVersion "
49
57
}
0 commit comments