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
When build or run command is executed, checks if the environment is properly configured for executing local builds. If it is not properly configured, {N} CLI shows a prompt and user is able to choice if to run setup script or use cloud builds.
If cloud builds option is selected, {N} CLI installs the nativescript-cloud extension and prints that user can use the $ tns login command to log in with his/her account and then $ tns cloud run/build android/ios command to build his/her app in the cloud.
If setup script option is selected, {N} CLI runs the setup script to try and automatically configure the environment. If the environment is not properly configured after executing the setup script, {N} CLI shows a prompt and user is able to choice if to use cloud builds or manually setup the environment. If the manually setup option is selected, {N} CLI prints: "To be able to build for android/ios, verify that your environment is configured according to the system requirements described at https://docs.nativescript.org/start/ns-setup-os-x.}"
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.`,
55
-
`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage your Android SDK versions.`);
message=`You have to install version ${versionRangeMatches[1]}.`;
67
-
}
68
-
69
-
letinvalidBuildToolsAdditionalMsg=`Run \`\$ ${this.getPathToSdkManagementTool()}\` from your command-line to install required \`Android Build Tools\`.`;
70
-
if(!isAndroidHomeValid){
71
-
invalidBuildToolsAdditionalMsg+=' In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly.';
72
-
}
73
48
74
-
this.printMessage("You need to have the Android SDK Build-tools installed on your system. "+message,invalidBuildToolsAdditionalMsg);
75
-
detectedErrors=true;
76
-
}
77
-
78
-
if(!toolsInfoData.supportRepositoryVersion){
79
-
letinvalidSupportLibAdditionalMsg=`Run \`\$ ${this.getPathToSdkManagementTool()}\` to manage the Android Support Repository.`;
80
-
if(!isAndroidHomeValid){
81
-
invalidSupportLibAdditionalMsg+=' In case you already have it installed, make sure `ANDROID_HOME` environment variable is set correctly.';
82
-
}
83
-
this.printMessage(`You need to have Android SDK ${AndroidToolsInfo.MIN_REQUIRED_COMPILE_TARGET} or later and the latest Android Support Repository installed on your system.`,invalidSupportLibAdditionalMsg);
constadditionalMessage="You will not be able to build your projects for Android."+EOL
113
-
+"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+
114
-
" described in "+this.$staticConfig.SYS_REQUIREMENTS_LINK;
this.printMessage(`Javac version ${installedJavacVersion} is not supported. You have to install at least ${AndroidToolsInfo.MIN_JAVA_VERSION}.`,additionalMessage);
this.printMessage(`Javac version ${installedJavacVersion} is not supported. You have to install version ${AndroidToolsInfo.MIN_JAVA_VERSION}.`,additionalMessage);
125
-
}
126
-
}else{
127
-
hasProblemWithJavaVersion=true;
128
-
this.printMessage("Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.",additionalMessage);
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.",
161
-
"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.",
165
-
"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, "+
166
-
"where you will find `tools` and `platform-tools` directories.");
this.$logger.out("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);
@@ -98,7 +128,15 @@ class DoctorService implements IDoctorService {
0 commit comments