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.
* Make androidSysInfo calls sync
As one of the methods in androidSysInfo no longer needs to be async, after removing its async signature, this lead to avalanche of methods that no longer needs to be async.
So fix all of them.
* 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.
* Code styling fixes
* Fix getting installed Android SDKs
this.printMessage(`Unable to find "${this.androidExecutableName}" executable file. Make sure you have set ANDROID_HOME environment variable correctly.`);
49
-
}
50
-
}else{
51
-
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.`,
100
-
"Run `$ android` to manage your Android SDK versions.");
53
+
`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage your Android SDK versions.`);
101
54
detectedErrors=true;
102
55
}
103
56
@@ -111,7 +64,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
111
64
message=`You have to install version ${versionRangeMatches[1]}.`;
112
65
}
113
66
114
-
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\`.`;
115
68
if(!isAndroidHomeValid){
116
69
invalidBuildToolsAdditionalMsg+=' In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly.';
117
70
}
@@ -121,7 +74,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
121
74
}
122
75
123
76
if(!toolsInfoData.supportRepositoryVersion){
124
-
letinvalidSupportLibAdditionalMsg='Run `$ android` to manage the Android Support Repository.';
77
+
letinvalidSupportLibAdditionalMsg=`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage the Android Support Repository.`;
125
78
if(!isAndroidHomeValid){
126
79
invalidSupportLibAdditionalMsg+=' In case you already have it installed, make sure `ANDROID_HOME` environment variable is set correctly.';
127
80
}
@@ -153,6 +106,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
letadditionalMessage="You will not be able to build your projects for Android."+EOL
157
111
+"To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as"+EOL+
158
112
" described in "+this.$staticConfig.SYS_REQUIREMENTS_LINK;
@@ -186,6 +140,51 @@ 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.",
154
+
"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.",
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, "+
159
+
"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.",
348
-
"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.",
352
-
"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, "+
353
-
"where you will find `tools` and `platform-tools` directories.");
0 commit comments