From 894c1d4a35ece0214d36e4bb7ec51b03e398a1d6 Mon Sep 17 00:00:00 2001 From: Olli Vuolteenaho Date: Thu, 6 Jun 2024 15:43:44 +0300 Subject: [PATCH] Fix path in Java QML component generation The parameter buildPath comes from QDir:absolutePath(), which gives a path that starts with '/' or a drive speficiation. When calling getImportPaths on a Windows machine the path becomes something like "/C://dev/qt5/...". As a result, androiddeployqt exists with a failure. On Linux/macOS systems this was not a problem because // = / Change-Id: I85376253055549344f06c9da9ebd67364e429112 Reviewed-by: Assam Boudjelthia (cherry picked from commit 776982a14e53e8661c3508c3d05e0efe538bc67e) Reviewed-by: Qt Cherry-pick Bot --- src/tools/androiddeployqt/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index eab943c0498..f9a645aadb7 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -3419,7 +3419,7 @@ int generateJavaQmlComponents(const Options &options) // For instance, it does not discover statically linked **inner** QML modules. const auto getImportPaths = [](const QString &buildPath, const QString &libName, QStringList &appImports, QStringList &externalImports) -> bool { - QFile confRspFile("/%1/.qt/qml_imports/%2_conf.rsp"_L1.arg(buildPath, libName)); + QFile confRspFile("%1/.qt/qml_imports/%2_conf.rsp"_L1.arg(buildPath, libName)); if (!confRspFile.exists() || !confRspFile.open(QFile::ReadOnly)) return false; QTextStream rspStream(&confRspFile);