You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix getting info for Android tools
Due to changes in Android SDK, we have to update the checks in CLI. While gathering system information, we check the android executable, which is no longer returning correct results.
We use the android executable to find information about installed Android SDKs and to construct correct paths based on ANDROID_HOME. Fix this by listing directories inside ANDROID_HOME and find the information about installed SDKs from there.
Fix messages pointing to `android` executable to point to `sdkmanager` (in case it exists).
In order to fix this, we rely on the emulator executable, which is the real thing we need as it is the one that allows us to work with Android Emulators (this is changed in mobile-cli-lib).
Fix sys-info checks and get correct path to emulator according to latest changes.
* Fix `emulate android --available-devices`
The command `tns emulate android --available-devices` should list the available Android Virtual Devices on the current machine.
It uses `android list avd` command which is no longer available. The alternative is to use the new `$ANDROID_HOME/tools/bin/avdmanager` executable or use the way we already have in the mobile-cli-lib - parse the `.ini` files of each device.
Use the methods from `androidEmulatorServices` so the code will work with both old and new SDKs.
* Fix getting installed Android SDKs
this.printMessage(`Unable to find "${this.androidExecutableName}" executable file. Make sure you have set ANDROID_HOME environment variable correctly.`);
50
-
}
51
-
}else{
52
-
this.$logger.trace("ANDROID_HOME environment variable is not set correctly.");
this.printMessage(`Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK ${AndroidToolsInfo.MIN_REQUIRED_COMPILE_TARGET} or later.`,
107
-
"Run `$ android` to manage your Android SDK versions.");
53
+
`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage your Android SDK versions.`);
108
54
detectedErrors=true;
109
55
}
110
56
@@ -118,7 +64,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
118
64
message=`You have to install version ${versionRangeMatches[1]}.`;
119
65
}
120
66
121
-
letinvalidBuildToolsAdditionalMsg='Run `android` from your command-line to install required `Android Build Tools`.';
67
+
letinvalidBuildToolsAdditionalMsg=`Run \`\$ ${this.getPathToSdkManagementTool()}\` from your command-line to install required \`Android Build Tools\`.`;
122
68
if(!isAndroidHomeValid){
123
69
invalidBuildToolsAdditionalMsg+=' In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly.';
124
70
}
@@ -128,7 +74,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
128
74
}
129
75
130
76
if(!toolsInfoData.supportRepositoryVersion){
131
-
letinvalidSupportLibAdditionalMsg='Run `$ android` to manage the Android Support Repository.';
77
+
letinvalidSupportLibAdditionalMsg=`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage the Android Support Repository.`;
132
78
if(!isAndroidHomeValid){
133
79
invalidSupportLibAdditionalMsg+=' In case you already have it installed, make sure `ANDROID_HOME` environment variable is set correctly.';
134
80
}
@@ -198,6 +144,54 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
this.printMessage("The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.",
158
+
"To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory.");
this.printMessage("The ANDROID_HOME environment variable points to incorrect directory. You will not be able to perform any build-related operations for Android.",
162
+
"To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory, "+
163
+
"where you will find `tools` and `platform-tools` directories.");
this.printMessage("The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.",
374
-
"To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory.");
this.printMessage("The ANDROID_HOME environment variable points to incorrect directory. You will not be able to perform any build-related operations for Android.",
378
-
"To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory, "+
379
-
"where you will find `tools` and `platform-tools` directories.");
0 commit comments