Add error messages in case system library directory does not exist

On Android, when the system library directory does not exist,
no error message was given. This led in turn to error messages like
Can't find 'nulllibQt6Core_armeabi-v7a.so'
which are not very helpful.

Pick-to: 6.2
Task-number: QTBUG-80766
Task-number: QTBUG-96701
Change-Id: I4187e4a68d9e78e198152306a3e664c30c51ab18
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
bb10
Andreas Buhr 2021-09-28 11:18:37 +02:00
parent 755f7c7ff2
commit 44c8ae5543
1 changed files with 10 additions and 2 deletions

View File

@ -275,16 +275,24 @@ public abstract class QtLoader {
Log.e(QtApplication.QtTAG, "Using " + SYSTEM_LIB_PATH + " as default path");
}
File systemLibraryDir = new File(systemLibsPrefix);
if (systemLibraryDir.exists() && systemLibraryDir.isDirectory() && systemLibraryDir.list().length > 0)
if (systemLibraryDir.exists() && systemLibraryDir.isDirectory() && systemLibraryDir.list().length > 0) {
libsDir = systemLibsPrefix;
} else {
Log.e(QtApplication.QtTAG,
"System library directory " + systemLibsPrefix
+ " does not exist or is empty.");
}
} else {
String nativeLibraryPrefix = m_context.getApplicationInfo().nativeLibraryDir + "/";
File nativeLibraryDir = new File(nativeLibraryPrefix);
if (nativeLibraryDir.exists() && nativeLibraryDir.isDirectory() && nativeLibraryDir.list().length > 0) {
libsDir = nativeLibraryPrefix;
bundledLibsDir = nativeLibraryPrefix;
} else {
Log.e(QtApplication.QtTAG,
"Native library directory " + nativeLibraryPrefix
+ " does not exist or is empty.");
}
}
if (apkDeployFromSystem && libsDir == null)