Skip to content

Commit d7da531

Browse files
Allow using Android SDK 27 (#3313)
* Allow using Android SDK 27 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 970e800 commit d7da531

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
@@ -6,7 +6,7 @@ import { appendZeroesToVersion } from './common/helpers';
66

77
export class AndroidToolsInfo implements IAndroidToolsInfo {
88
private static ANDROID_TARGET_PREFIX = "android";
9-
private static SUPPORTED_TARGETS = ["android-17", "android-18", "android-19", "android-21", "android-22", "android-23", "android-24", "android-25", "android-26"];
9+
private static SUPPORTED_TARGETS = ["android-17", "android-18", "android-19", "android-21", "android-22", "android-23", "android-24", "android-25", "android-26", "android-27"];
1010
private static MIN_REQUIRED_COMPILE_TARGET = 22;
1111
private static REQUIRED_BUILD_TOOLS_RANGE_PREFIX = ">=23";
1212
private static VERSION_REGEX = /((\d+\.){2}\d+)/;
@@ -306,6 +306,10 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
306306
if (this.androidHome && requiredAppCompatRange) {
307307
const pathToAppCompat = path.join(this.androidHome, "extras", "android", "m2repository", "com", "android", "support", "appcompat-v7");
308308
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, requiredAppCompatRange);
309+
if (!selectedAppCompatVersion) {
310+
// get latest matching version, as there's no available appcompat versions for latest SDK versions.
311+
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, "*");
312+
}
309313
}
310314

311315
this.$logger.trace(`Selected AppCompat version is: ${selectedAppCompatVersion}`);

0 commit comments

Comments
 (0)