Skip to content

Commit 11581a6

Browse files
mrkpatchaakadikraman
authored andcommitted
Updated to work with newer versions of RN (#247)
* Updated to work with newer versions of RN * Revert back to compile as it could break projects using RN < 0.57 * Fix buildToolsVersion
1 parent 298c46f commit 11581a6

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

android/build.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1+
def safeExtGet(prop, fallback) {
2+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3+
}
14

25
buildscript {
36
repositories {
7+
maven {
8+
url 'https://maven.google.com/'
9+
name 'Google'
10+
}
411
jcenter()
512
}
613

714
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.2'
15+
classpath 'com.android.tools.build:gradle:3.2.1'
916
}
1017
}
1118

1219
apply plugin: 'com.android.library'
1320

1421
android {
15-
compileSdkVersion 27
16-
buildToolsVersion '28.0.2'
22+
compileSdkVersion safeExtGet('compileSdkVersion', 27)
23+
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.2')
1724

1825
defaultConfig {
19-
minSdkVersion 16
20-
targetSdkVersion 26
26+
minSdkVersion safeExtGet('minSdkVersion', 16)
27+
targetSdkVersion safeExtGet('targetSdkVersion', 26)
2128
versionCode 1
2229
versionName "1.0"
2330
manifestPlaceholders = [
@@ -34,6 +41,6 @@ repositories {
3441
}
3542

3643
dependencies {
37-
compile 'com.facebook.react:react-native:+'
38-
compile "net.openid:appauth:0.7.1"
44+
compile 'com.facebook.react:react-native:'+safeExtGet('reactNativeVersion', '+')
45+
compile 'net.openid:appauth:0.7.1'
3946
}

0 commit comments

Comments
 (0)