From 3073097f3800f77b47457e2b28c22badbc9133a3 Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Thu, 20 Sep 2018 00:34:11 +0800 Subject: [PATCH 1/2] extract targetSdkVersion and use as MAJOR value --- scripts/validate-android-test-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate-android-test-env.sh b/scripts/validate-android-test-env.sh index 14677e91f50e97..3ac58295fa2cc9 100755 --- a/scripts/validate-android-test-env.sh +++ b/scripts/validate-android-test-env.sh @@ -56,7 +56,7 @@ fi BUILD_TOOLS_VERSION=`grep buildToolsVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/^[^"]*\"//' | sed 's/"//'` # MAJOR is something like "23" -MAJOR=`echo $BUILD_TOOLS_VERSION | sed 's/\..*//'` +MAJOR=`grep targetSdkVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/[^[:digit:]]//g'` # Check that we have the right major version of the Android SDK. PLATFORM_DIR="$ANDROID_HOME/platforms/android-$MAJOR" From 162efaf52564b37c3707765b64668cae40c8cabb Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Thu, 20 Sep 2018 00:34:11 +0800 Subject: [PATCH 2/2] use compileSdkVersion as MAJOR --- scripts/validate-android-test-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate-android-test-env.sh b/scripts/validate-android-test-env.sh index 3ac58295fa2cc9..965a191cb582fb 100755 --- a/scripts/validate-android-test-env.sh +++ b/scripts/validate-android-test-env.sh @@ -56,7 +56,7 @@ fi BUILD_TOOLS_VERSION=`grep buildToolsVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/^[^"]*\"//' | sed 's/"//'` # MAJOR is something like "23" -MAJOR=`grep targetSdkVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/[^[:digit:]]//g'` +MAJOR=`grep compileSdkVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/[^[:digit:]]//g'` # Check that we have the right major version of the Android SDK. PLATFORM_DIR="$ANDROID_HOME/platforms/android-$MAJOR"