File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,17 @@ class AndroidHelper
189189
190190 if (project .environment .exists (" JAVA_HOME" ))
191191 {
192+ var javaHome = project .environment .get (" JAVA_HOME" );
193+ if (! FileSystem .exists (javaHome ))
194+ {
195+ Log .error (" The path specified for JAVA_HOME does not exist: " + javaHome );
196+ Sys .exit (1 );
197+ }
198+ if (! FileSystem .isDirectory (javaHome ))
199+ {
200+ Log .error (" The path specified for JAVA_HOME must be a directory: " + javaHome );
201+ Sys .exit (1 );
202+ }
192203 Sys .putEnv (" JAVA_HOME" , project .environment .get (" JAVA_HOME" ));
193204 }
194205 }
Original file line number Diff line number Diff line change @@ -519,6 +519,31 @@ class AndroidPlatform extends PlatformTarget
519519 Log .error (" You must define ANDROID_SDK and ANDROID_NDK_ROOT to target Android, please run '" + command + " setup android' first" );
520520 Sys .exit (1 );
521521 }
522+ else
523+ {
524+ var sdkPath = project .environment .get (" ANDROID_SDK" );
525+ if (! FileSystem .exists (sdkPath ))
526+ {
527+ Log .error (" The path specified for ANDROID_SDK does not exist: " + sdkPath );
528+ Sys .exit (1 );
529+ }
530+ if (! FileSystem .isDirectory (sdkPath ))
531+ {
532+ Log .error (" The path specified for ANDROID_SDK must be a directory: " + sdkPath );
533+ Sys .exit (1 );
534+ }
535+ var ndkPath = project .environment .get (" ANDROID_NDK_ROOT" );
536+ if (! FileSystem .exists (ndkPath ))
537+ {
538+ Log .error (" The path specified for ANDROID_NDK_ROOT does not exist: " + ndkPath );
539+ Sys .exit (1 );
540+ }
541+ if (! FileSystem .isDirectory (ndkPath ))
542+ {
543+ Log .error (" The path specified for ANDROID_NDK_ROOT must be a directory: " + ndkPath );
544+ Sys .exit (1 );
545+ }
546+ }
522547
523548 if (project .config .exists (" android.gradle-build-directory" ))
524549 {
You can’t perform that action at this time.
0 commit comments