@@ -95,7 +95,7 @@ class AndroidSDK {
95
95
private static final String INVALID_SDK_MESSAGE =
96
96
"Processing found an Android SDK, but is not valid. It could be missing " +
97
97
"some files, or might not be including the required platform for " +
98
- "API " + AndroidBuild .TARGET_SDK + "<br><br>" +
98
+ "API " + AndroidBuild .TARGET_SDK + ". <br><br>" +
99
99
"If a valid SDK is available in a different location, " +
100
100
"click \" Locate SDK path\" to select it, or \" Download SDK\" to let " +
101
101
"Processing download the SDK automatically.<br><br>" +
@@ -395,8 +395,7 @@ public static AndroidSDK load(boolean checkEnvSDK, Frame editor) throws IOExcept
395
395
// Give priority to preferences:
396
396
// https://github.com/processing/processing-android/issues/372
397
397
final String sdkPrefsPath = Preferences .get ("android.sdk.path" );
398
- System .out .println ("Processing preferences: " + sdkPrefsPath );
399
- if (sdkPrefsPath != null ) {
398
+ if (sdkPrefsPath != null && !sdkPrefsPath .equals ("" )) {
400
399
try {
401
400
final AndroidSDK androidSDK = new AndroidSDK (new File (sdkPrefsPath ));
402
401
Preferences .set ("android.sdk.path" , sdkPrefsPath );
@@ -408,7 +407,7 @@ public static AndroidSDK load(boolean checkEnvSDK, Frame editor) throws IOExcept
408
407
}
409
408
410
409
final String sdkEnvPath = Platform .getenv ("ANDROID_SDK" );
411
- if (sdkEnvPath != null ) {
410
+ if (sdkEnvPath != null && ! sdkEnvPath . equals ( "" ) ) {
412
411
try {
413
412
final AndroidSDK androidSDK = new AndroidSDK (new File (sdkEnvPath ));
414
413
@@ -417,7 +416,7 @@ public static AndroidSDK load(boolean checkEnvSDK, Frame editor) throws IOExcept
417
416
// the option to not to use it. After this, we should go straight to
418
417
// download a new SDK.
419
418
int result = showEnvSDKDialog (editor );
420
- if (result == JOptionPane .NO_OPTION ) {
419
+ if (result != JOptionPane .YES_OPTION ) {
421
420
loadError = SKIP_ENV_SDK ;
422
421
return null ;
423
422
}
0 commit comments