There was a bug in QT 5.15.2 that results in app crash on Android 5.1 and a patch:
Submodule qtbase contains modified content
diff --git a/qtbase/src/corelib/plugin/qlibrary_unix.cpp b/qtbase/src/corelib/plugin/qlibrary_unix.cpp
index a5c72f81d9..5cd21b67a4 100644
--- a/qtbase/src/corelib/plugin/qlibrary_unix.cpp
+++ b/qtbase/src/corelib/plugin/qlibrary_unix.cpp
@@ -243,10 +243,10 @@ bool QLibraryPrivate::load_sys()
}
if (hnd) {
using JniOnLoadPtr = jint (*)(JavaVM *vm, void *reserved);
- JniOnLoadPtr jniOnLoad = reinterpret_cast<JniOnLoadPtr>(dlsym(pHnd, "JNI_OnLoad"));
+ JniOnLoadPtr jniOnLoad = reinterpret_cast<JniOnLoadPtr>(dlsym(hnd, "JNI_OnLoad"));
if (jniOnLoad && jniOnLoad(QtAndroidPrivate::javaVM(), nullptr) == JNI_ERR) {
dlclose(hnd);
- pHnd = nullptr;
+ hnd = nullptr;
}
}
#endif
Looks like it was simply a typo and pHnd
was replaced with hnd
.
QT 5.15.3 where the bug was fixed is commercial so I applied the patch by myself (thanks to danilabagroff
from stackoverflow.com):