Skip to content

Commit 36d0a60

Browse files
Add Android SDK 27 as verified
Add version 27 of Android SDK as verified, so users will use it by default when it is installed. Use latest available appCompat version The current CLI logic finds appCompat version that matches the selected SDK version. However, the latest appCompat version is 26.0.0-alpha, so in case we have Android SDK 27, we are unable to find matchin appCompat. In order to resolve the issue and allow using Android SDK 27, get latest available appCompat version when there's no matching one
1 parent 22aa3c5 commit 36d0a60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/android-tools-info.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as path from "path";
99

1010
export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
1111
private static ANDROID_TARGET_PREFIX = "android";
12-
private static SUPPORTED_TARGETS = ["android-17", "android-18", "android-19", "android-21", "android-22", "android-23", "android-24", "android-25", "android-26"];
12+
private static SUPPORTED_TARGETS = ["android-17", "android-18", "android-19", "android-21", "android-22", "android-23", "android-24", "android-25", "android-26", "android-27"];
1313
private static MIN_REQUIRED_COMPILE_TARGET = 22;
1414
private static REQUIRED_BUILD_TOOLS_RANGE_PREFIX = ">=23";
1515
private static VERSION_REGEX = /((\d+\.){2}\d+)/;
@@ -271,6 +271,10 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
271271
if (this.androidHome && requiredAppCompatRange) {
272272
const pathToAppCompat = path.join(this.androidHome, "extras", "android", "m2repository", "com", "android", "support", "appcompat-v7");
273273
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, requiredAppCompatRange);
274+
if (!selectedAppCompatVersion) {
275+
// get latest matching version, as there's no available appcompat versions for latest SDK versions.
276+
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, "*");
277+
}
274278
}
275279

276280
return selectedAppCompatVersion;

0 commit comments

Comments
 (0)