Skip to content

Commit 5e7f9f5

Browse files
authored
fix(android): Use root project build sdk version (#23)
#20 Explicitly setting these build values causes incompatible SDKs versions to fail with `Execution failed for task ':react-native-user-agent:verifyReleaseResources'.` Fixes #20
1 parent 718c76f commit 5e7f9f5

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

android/build.gradle

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

25
buildscript {
36
repositories {
@@ -12,15 +15,16 @@ buildscript {
1215
apply plugin: 'com.android.library'
1316

1417
android {
15-
compileSdkVersion 27
16-
buildToolsVersion "27.0.3"
18+
compileSdkVersion safeExtGet('compileSdkVersion', 27)
19+
buildToolsVersion safeExtGet('buildToolsVersion', '27.0.3')
1720

1821
defaultConfig {
19-
minSdkVersion 16
20-
targetSdkVersion 22
22+
minSdkVersion safeExtGet('minSdkVersion', 16)
23+
targetSdkVersion safeExtGet('targetSdkVersion', 22)
2124
versionCode 1
2225
versionName "1.0"
2326
}
27+
2428
lintOptions {
2529
abortOnError false
2630
}
@@ -33,4 +37,3 @@ repositories {
3337
dependencies {
3438
compile 'com.facebook.react:react-native:+'
3539
}
36-

0 commit comments

Comments
 (0)