Skip to content

Commit

Permalink
fix(android): Use root project build sdk version (#23)
Browse files Browse the repository at this point in the history
#20

Explicitly setting these build values causes incompatible SDKs versions to fail with `Execution failed for task ':react-native-user-agent:verifyReleaseResources'.`

Fixes #20
  • Loading branch information
JeremyJonas authored Feb 10, 2022
1 parent 718c76f commit 5e7f9f5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

buildscript {
repositories {
Expand All @@ -12,15 +15,16 @@ buildscript {
apply plugin: 'com.android.library'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion safeExtGet('compileSdkVersion', 27)
buildToolsVersion safeExtGet('buildToolsVersion', '27.0.3')

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 22)
versionCode 1
versionName "1.0"
}

lintOptions {
abortOnError false
}
Expand All @@ -33,4 +37,3 @@ repositories {
dependencies {
compile 'com.facebook.react:react-native:+'
}

0 comments on commit 5e7f9f5

Please sign in to comment.