Android: fix ClassLoader warning

The Dex value provided is an empty string which leads
to this system warning when initiating an instance of
the ClassLoader

 W System  : ClassLoader referenced unknown path:

This patch fixes it by providing a valid path.

Task-number: QTBUG-115016
Change-Id: I6dcd396a07337278224e07b0271f49bb829ea0ce
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
bb10
Assam Boudjelthia 2023-09-25 23:04:45 +01:00
parent db91947eb0
commit 6f1449c7ae
1 changed files with 2 additions and 1 deletions

View File

@ -146,7 +146,8 @@ public abstract class QtLoader {
{
// directory where optimized DEX files should be written.
String outDexPath = m_context.getDir("outdex", Context.MODE_PRIVATE).getAbsolutePath();
m_classLoader = new DexClassLoader("", outDexPath, null, m_context.getClassLoader());
String sourceDir = m_context.getApplicationInfo().sourceDir;
m_classLoader = new DexClassLoader(sourceDir, outDexPath, null, m_context.getClassLoader());
QtNative.setClassLoader(m_classLoader);
}