summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wynn Garcia <markwynngarcia@outlook.com>2020-01-26 11:45:17 +0800
committerMark Wynn Garcia <markwynngarcia@outlook.com>2020-01-26 11:45:17 +0800
commit141230192cb534a8e6e2ce7d1c7abcc7ec5d9a33 (patch)
tree20eaac604c6d1cc8598261a568823f310642a97c
parentbe1bc53d42577c02cbdf32fff5e2a60234e6270a (diff)
Check if can export before exporting; show error message if can't export.
-rw-r--r--platform/android/export/export.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 0ebd97d428..52ab2a317d 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1495,17 +1495,19 @@ public:
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
ERR_FAIL_INDEX_V(p_device, devices.size(), ERR_INVALID_PARAMETER);
+
+ String can_export_error;
+ bool can_export_missing_templates;
+ if (!can_export(p_preset, can_export_error, can_export_missing_templates)) {
+ EditorNode::add_io_error(can_export_error);
+ return ERR_UNCONFIGURED;
+ }
+
device_lock->lock();
EditorProgress ep("run", "Running on " + devices[p_device].name, 3);
String adb = EditorSettings::get_singleton()->get("export/android/adb");
- if (adb == "") {
-
- EditorNode::add_io_error("ADB executable not configured in settings, can't run.");
- device_lock->unlock();
- return ERR_UNCONFIGURED;
- }
// Export_temp APK.
if (ep.step("Exporting APK", 0)) {