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
* Add check for JAVA 9
Currently Gradle cannot work with JAVA 9, so detect if it has been used return correct warning.
Fix detection of Javac version
The command `javac -version` prints result to stderr when JAVA 8 is used and to stdout when JAVA 9 is used. Current check uses the stderr output, so when JAVA 9 is installed it fails to detect the correct version.
In order to support both JAVA 8 and JAVA 9, capture both stdout and stderr and get the version from there.
Also remove unneeded check for Java version - we care about JAVA Compiler, which is included in JDK.
* Handle case when Javac version is a single number (9 for example)
In some cases javac version is a single number, for example 9. In this case our validation fails to detect the correct version and to check if we support this version.
In order to resolve this issue, use the `appendZeroesToVersion` method in order to make the versin semver valid.
letadditionalMessage="You will not be able to build your projects for Android."+EOL
93
96
+"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+
94
97
" described in "+this.getSystemRequirementsLink();
warning=`Javac version ${installedJavaCompilerVersion} is not supported. You have to install version ${AndroidToolsInfo.MIN_JAVA_VERSION}.`;
108
+
}
109
+
110
+
if(warning){
98
111
errors.push({
99
-
warning: `Javac version ${installedJavaVersion} is not supported. You have to install at least ${AndroidToolsInfo.MIN_JAVA_VERSION}.`,
112
+
warning,
100
113
additionalInformation: additionalMessage,
101
114
platforms: [Constants.ANDROID_PLATFORM_NAME]
102
115
});
@@ -140,7 +153,7 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
140
153
errors.push({
141
154
warning: "The ANDROID_HOME environment variable points to incorrect directory. You will not be able to perform any build-related operations for Android.",
142
155
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.",
156
+
"where you will find `tools` and `platform-tools` directories.",
144
157
platforms: [Constants.ANDROID_PLATFORM_NAME]
145
158
});
146
159
}
@@ -299,22 +312,7 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
0 commit comments