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
errors.push(`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.`,
43
-
`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage your Android SDK versions.`);
44
+
errors.push({
45
+
warning: `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.`,
46
+
additionalInformation: `Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage your Android SDK versions.`,
47
+
platforms: [Constants.ANDROID_PLATFORM_NAME]
48
+
});
44
49
}
45
50
46
51
if(!toolsInfoData.buildToolsVersion){
@@ -58,33 +63,50 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
58
63
invalidBuildToolsAdditionalMsg+=' In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly.';
59
64
}
60
65
61
-
errors.push("You need to have the Android SDK Build-tools installed on your system. "+message,invalidBuildToolsAdditionalMsg);
66
+
errors.push({
67
+
warning: "You need to have the Android SDK Build-tools installed on your system. "+message,
letinvalidSupportLibAdditionalMsg=`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage the Android Support Repository.`;
66
75
if(!isAndroidHomeValid){
67
76
invalidSupportLibAdditionalMsg+=' In case you already have it installed, make sure `ANDROID_HOME` environment variable is set correctly.';
68
77
}
69
-
errors.push(`You need to have Android SDK ${AndroidToolsInfo.MIN_REQUIRED_COMPILE_TARGET} or later and the latest Android Support Repository installed on your system.`,invalidSupportLibAdditionalMsg);
78
+
79
+
errors.push({
80
+
warning: `You need to have Android SDK ${AndroidToolsInfo.MIN_REQUIRED_COMPILE_TARGET} or later and the latest Android Support Repository installed on your system.`,
letadditionalMessage="You will not be able to build your projects for Android."+EOL
79
93
+"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+
80
94
" described in "+this.getSystemRequirementsLink();
errors.push(`Javac version ${installedJavaVersion} is not supported. You have to install at least ${AndroidToolsInfo.MIN_JAVA_VERSION}.`,additionalMessage);
98
+
errors.push({
99
+
warning: `Javac version ${installedJavaVersion} is not supported. You have to install at least ${AndroidToolsInfo.MIN_JAVA_VERSION}.`,
100
+
additionalInformation: additionalMessage,
101
+
platforms: [Constants.ANDROID_PLATFORM_NAME]
102
+
});
85
103
}
86
104
}else{
87
-
errors.push("Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.",additionalMessage);
105
+
errors.push({
106
+
warning: "Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.",
107
+
additionalInformation: additionalMessage,
108
+
platforms: [Constants.ANDROID_PLATFORM_NAME]
109
+
});
88
110
}
89
111
90
112
returnerrors;
@@ -104,22 +126,51 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
errors.push("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.",
113
-
"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.");
134
+
errors.push({
135
+
warning: "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.",
136
+
additionalInformation: "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.",
errors.push("The ANDROID_HOME environment variable points to incorrect directory. You will not be able to perform any build-related operations for Android.",
116
-
"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, "+
117
-
"where you will find `tools` and `platform-tools` directories.");
140
+
errors.push({
141
+
warning: "The ANDROID_HOME environment variable points to incorrect directory. You will not be able to perform any build-related operations for Android.",
142
+
additionalInformation: "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, "+
143
+
"where you will find `tools` and `platform-tools` directories.",
@@ -153,4 +171,12 @@ export class Doctor implements NativeScriptDoctor.IDoctor {
153
171
thrownewError(`Platform ${platform} is not supported.The supported platforms are: ${Constants.SUPPORTED_PLATFORMS.join(", ")} `);
154
172
}
155
173
}
174
+
175
+
privategetPackageManagerTip(): string{
176
+
if(this.hostInfo.isWindows){
177
+
return"TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies."+EOL;
178
+
}elseif(this.hostInfo.isDarwin){
179
+
return"TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies."+EOL;
0 commit comments