diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-02-27 16:52:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-27 16:52:25 +0100 |
commit | 0e8fae1038cb27372777623b1af26e6f0cfb34fa (patch) | |
tree | 6b43a11265cea07993df5089b1d38ddc85421134 | |
parent | 8870bc7fd092dcddfd81d6d1b171a3d821b26981 (diff) | |
parent | 6f0ca6c9f7ae08974ba321043383725ca8dee0c6 (diff) |
Merge pull request #46457 from m4gr3d/fix_invalid_missing_templates_error_master
Fix invalid missing template error when the Android build template is not installed
-rw-r--r-- | platform/android/export/export.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 7dce7eec14..326e513261 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1995,6 +1995,7 @@ public: String template_err; bool dvalid = false; bool rvalid = false; + bool has_export_templates = false; if (p_preset->get("custom_template/debug") != "") { dvalid = FileAccess::exists(p_preset->get("custom_template/debug")); @@ -2002,7 +2003,7 @@ public: template_err += TTR("Custom debug template not found.") + "\n"; } } else { - dvalid = exists_export_template("android_debug.apk", &template_err); + has_export_templates |= exists_export_template("android_debug.apk", &template_err); } if (p_preset->get("custom_template/release") != "") { @@ -2011,22 +2012,24 @@ public: template_err += TTR("Custom release template not found.") + "\n"; } } else { - rvalid = exists_export_template("android_release.apk", &template_err); + has_export_templates |= exists_export_template("android_release.apk", &template_err); } - valid = dvalid || rvalid; + r_missing_templates = !has_export_templates; + valid = dvalid || rvalid || has_export_templates; if (!valid) { err += template_err; } } else { - valid = exists_export_template("android_source.zip", &err); + r_missing_templates = !exists_export_template("android_source.zip", &err); - if (!FileAccess::exists("res://android/build/build.gradle")) { + bool installed_android_build_template = FileAccess::exists("res://android/build/build.gradle"); + if (!installed_android_build_template) { err += TTR("Android build template not installed in the project. Install it from the Project menu.") + "\n"; - valid = false; } + + valid = installed_android_build_template && !r_missing_templates; } - r_missing_templates = !valid; // Validate the rest of the configuration. |