Skip to content

Commit bd40a6f

Browse files
feat: remove requirement for Android Support Repository installation
In the past there was a requirement to have a local copy of the Android Support Repository in order to use it in your application. However, since some time the new versions of the libraries are in the Google repository, so there's no need to have them locally.
1 parent 978d5ef commit bd40a6f

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

lib/android-tools-info.ts

-39
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
3030
infoData.androidHomeEnvVar = this.androidHome;
3131
infoData.compileSdkVersion = this.getCompileSdk();
3232
infoData.buildToolsVersion = this.getBuildToolsVersion();
33-
infoData.supportRepositoryVersion = this.getAndroidSupportRepositoryVersion();
3433

3534
this.toolsInfo = infoData;
3635
}
@@ -72,19 +71,6 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
7271
});
7372
}
7473

75-
if (!toolsInfoData.supportRepositoryVersion) {
76-
let invalidSupportLibAdditionalMsg = `Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage the Android Support Repository.`;
77-
if (!isAndroidHomeValid) {
78-
invalidSupportLibAdditionalMsg += ' In case you already have it installed, make sure `ANDROID_HOME` environment variable is set correctly.';
79-
}
80-
81-
errors.push({
82-
warning: `You need to have Android SDK ${AndroidToolsInfo.MIN_REQUIRED_COMPILE_TARGET} or later and the latest Android Support Repository installed on your system.`,
83-
additionalInformation: invalidSupportLibAdditionalMsg,
84-
platforms: [Constants.ANDROID_PLATFORM_NAME]
85-
});
86-
}
87-
8874
return errors;
8975
}
9076

@@ -275,31 +261,6 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
275261
return buildToolsVersion;
276262
}
277263

278-
private getAppCompatRange(): string {
279-
let compileSdkVersion = this.getCompileSdk();
280-
let requiredAppCompatRange: string;
281-
if (compileSdkVersion) {
282-
requiredAppCompatRange = `>=${compileSdkVersion} <${compileSdkVersion + 1}`;
283-
}
284-
285-
return requiredAppCompatRange;
286-
}
287-
288-
private getAndroidSupportRepositoryVersion(): string {
289-
let selectedAppCompatVersion: string;
290-
const requiredAppCompatRange = this.getAppCompatRange();
291-
if (this.androidHome && requiredAppCompatRange) {
292-
const pathToAppCompat = path.join(this.androidHome, "extras", "android", "m2repository", "com", "android", "support", "appcompat-v7");
293-
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, requiredAppCompatRange);
294-
if (!selectedAppCompatVersion) {
295-
// get latest matching version, as there's no available appcompat versions for latest SDK versions.
296-
selectedAppCompatVersion = this.getMatchingDir(pathToAppCompat, "*");
297-
}
298-
}
299-
300-
return selectedAppCompatVersion;
301-
}
302-
303264
private getLatestValidAndroidTarget(): string {
304265
const installedTargets = this.getInstalledTargets();
305266
let latestValidAndroidTarget: string;

typings/interfaces.ts

-5
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,5 @@ declare module NativeScriptDoctor {
489489
* The latest installed version of Android SDK that satisfies CLI's requirements.
490490
*/
491491
compileSdkVersion: number;
492-
493-
/**
494-
* The latest installed version of Android Support Repository that satisfies CLI's requirements.
495-
*/
496-
supportRepositoryVersion: string;
497492
}
498493
}

0 commit comments

Comments
 (0)