|
28 | 28 | import org.xml.sax.SAXException; |
29 | 29 |
|
30 | 30 | import processing.app.Platform; |
| 31 | +import processing.app.Preferences; |
31 | 32 | import processing.app.ui.Toolkit; |
32 | 33 | import processing.core.PApplet; |
33 | 34 |
|
@@ -96,8 +97,10 @@ class DownloadTask extends SwingWorker<Object, Object> { |
96 | 97 | protected Object doInBackground() throws Exception { |
97 | 98 | result = false; |
98 | 99 |
|
99 | | - File modeFolder = mode.getFolder(); |
100 | | - File sdkFolder = new File(modeFolder, "sdk"); |
| 100 | + // The SDK should already be detected by the android mode |
| 101 | + String sdkPrefsPath = Preferences.get("android.sdk.path"); |
| 102 | + File sdkFolder = new File(sdkPrefsPath); |
| 103 | + File modeFolder = mode.getFolder(); |
101 | 104 | if (!sdkFolder.exists()) { |
102 | 105 | throw new IOException("SDK folder does not exist " + sdkFolder.getAbsolutePath()); |
103 | 106 | } |
@@ -127,7 +130,7 @@ protected Object doInBackground() throws Exception { |
127 | 130 | downloadAndUnpack(downloadUrls.sysImgWearUrl, downloadedSysImgWear, sysImgWearFinalFolder, false); |
128 | 131 | fixSourceProperties(sysImgWearFinalFolder); |
129 | 132 | } else { |
130 | | - // default system images |
| 133 | + // mobile system images |
131 | 134 | File downloadedSysImg = new File(tempFolder, downloadUrls.sysImgFilename); |
132 | 135 | File tmp = new File(sysImgFolder, "android-" + AndroidBuild.target_sdk); |
133 | 136 | if (!tmp.exists()) tmp.mkdir(); |
|
0 commit comments