Skip to content

Commit f2db78f

Browse files
committed
Fix support for RN 0.56+ by modernizing the build.gradle.
1 parent 676619c commit f2db78f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

android/build.gradle

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1+
def safeExtGet(prop, fallback) {
2+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3+
}
4+
15
buildscript {
26
repositories {
37
jcenter()
48
}
59

610
dependencies {
7-
classpath 'com.android.tools.build:gradle:1.1.3'
11+
classpath 'com.android.tools.build:gradle:2.2.3'
812
}
913
}
1014

1115
apply plugin: 'com.android.library'
1216

1317
android {
14-
compileSdkVersion 23
15-
buildToolsVersion "23.0.1"
18+
compileSdkVersion safeExtGet('compileSdkVersion', 26)
19+
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
1620

1721
defaultConfig {
18-
minSdkVersion 16
19-
targetSdkVersion 22
22+
minSdkVersion safeExtGet('minSdkVersion', 16)
23+
targetSdkVersion safeExtGet('targetSdkVersion', 26)
2024
versionCode 1
2125
versionName "1.0"
2226
}
@@ -31,4 +35,4 @@ repositories {
3135

3236
dependencies {
3337
compile 'com.facebook.react:react-native:0.12.+'
34-
}
38+
}

0 commit comments

Comments
 (0)