diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 35d422215290..1a7db429a4ad 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -170,8 +170,6 @@ Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_han so_file_exists = false; } - ERR_FAIL_COND_V(!FileAccess::exists(path), ERR_FILE_NOT_FOUND); - p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW); if (!p_library_handle && so_file_exists) { // The library may be on the sdcard and thus inaccessible. Try to copy it to the internal @@ -199,6 +197,7 @@ Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_han } } + ERR_FAIL_COND_V(!p_library_handle && !so_file_exists, ERR_FILE_NOT_FOUND); ERR_FAIL_NULL_V_MSG(p_library_handle, ERR_CANT_OPEN, vformat("Can't open dynamic library: %s. Error: %s.", p_path, dlerror())); if (r_resolved_path != nullptr) {