diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-10-28 10:03:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-28 10:03:18 +0100 |
commit | 45da7d579a1fd39b2a5c06947a4cb961a9b33fc4 (patch) | |
tree | ebf866ee30b40c24cf33f373119e4169f01cc85b /platform | |
parent | 60ad64a1016bbefea0ae54f18a77a9f16ceeba6d (diff) | |
parent | b271315bac2518217b09a78054780db01d5796fb (diff) |
Merge pull request #43153 from nekomatata/android-build-version-close
Release .build_version file handle in Android custom build export
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/export/export.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 37da1dbd4d..943a473717 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -2297,15 +2297,18 @@ public: if (use_custom_build) { //test that installed build version is alright - FileAccessRef f = FileAccess::open("res://android/.build_version", FileAccess::READ); - if (!f) { - EditorNode::get_singleton()->show_warning(TTR("Trying to build from a custom built template, but no version info for it exists. Please reinstall from the 'Project' menu.")); - return ERR_UNCONFIGURED; - } - String version = f->get_line().strip_edges(); - if (version != VERSION_FULL_CONFIG) { - EditorNode::get_singleton()->show_warning(vformat(TTR("Android build version mismatch:\n Template installed: %s\n Godot Version: %s\nPlease reinstall Android build template from 'Project' menu."), version, VERSION_FULL_CONFIG)); - return ERR_UNCONFIGURED; + { + FileAccessRef f = FileAccess::open("res://android/.build_version", FileAccess::READ); + if (!f) { + EditorNode::get_singleton()->show_warning(TTR("Trying to build from a custom built template, but no version info for it exists. Please reinstall from the 'Project' menu.")); + return ERR_UNCONFIGURED; + } + String version = f->get_line().strip_edges(); + f->close(); + if (version != VERSION_FULL_CONFIG) { + EditorNode::get_singleton()->show_warning(vformat(TTR("Android build version mismatch:\n Template installed: %s\n Godot Version: %s\nPlease reinstall Android build template from 'Project' menu."), version, VERSION_FULL_CONFIG)); + return ERR_UNCONFIGURED; + } } String sdk_path = EDITOR_GET("export/android/custom_build_sdk_path"); ERR_FAIL_COND_V_MSG(sdk_path == "", ERR_UNCONFIGURED, "Android SDK path must be configured in Editor Settings at 'export/android/custom_build_sdk_path'."); |