Skip to content

Commit

Permalink
Use latest available appCompat version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rosen-vladimirov committed Jan 10, 2018
1 parent b018c9c commit 131deb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/android-tools-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
if (this.androidHome && requiredAppCompatRange) {
const pathToAppCompat = path.join(this.androidHome, "extras", "android", "m2repository", "com", "android", "support", "appcompat-v7");
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, requiredAppCompatRange);
if (!selectedAppCompatVersion) {
// get latest matching version, as there's no available appcompat versions for latest SDK versions.
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, "*");
}
}

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

0 comments on commit 131deb4

Please sign in to comment.