Skip to content

Commit 2dcb964

Browse files
committed
check if android.jar exists, also try fallback option
1 parent 25dd58a commit 2dcb964

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/processing/mode/android/AndroidMode.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,25 @@ public String getSearchPath() {
164164
}
165165

166166
if (sdk == null) {
167-
Messages.log("Android SDK path couldn't be loaded.");
168-
return "";
167+
Messages.log("Android SDK path couldn't be loaded.");
168+
return "";
169169
}
170170

171171
String androidJarPath = sdk.getSdkFolder().getAbsolutePath() +
172172
File.separator + "platforms" + File.separator + "android-" +
173173
AndroidBuild.sdkVersion + File.separator + "android.jar";
174+
175+
if (!new File(androidJarPath).exists()) {
176+
// Try again using SDK name, I have seen the SDK stored as platforms/android-x.y.z
177+
androidJarPath = sdk.getSdkFolder().getAbsolutePath() +
178+
File.separator + "platforms" + File.separator + "android-" +
179+
AndroidBuild.sdkName + File.separator + "android.jar";
180+
if (!new File(androidJarPath).exists()) {
181+
Messages.log("Android SDK path couldn't be loaded.");
182+
return "";
183+
}
184+
}
185+
174186
String processingAndroidCoreJarPath = new File(getFolder(), "android-core.zip").getAbsolutePath();
175187
return androidJarPath + File.pathSeparatorChar + processingAndroidCoreJarPath;
176188
}

0 commit comments

Comments
 (0)