aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2020-07-03 19:57:35 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2020-07-08 07:07:31 +0000
commit697a7ad6db79e25484ac7034207d7a7fb1ca4e37 (patch)
treee96ae6c78380d35d6dede7b981eba2ddd4b5ed7b
parent9182d4eda75033bbbebf50e87e518adc33d499f6 (diff)
Android: fix qml debugger not starting on Qt 5.14+
Task-number: QTCREATORBUG-24155 Change-Id: Iddc5f7cb31a3512762d1e72b42108e5ed61bd9af Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r--src/plugins/android/androidpackageinstallationstep.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp
index 2d4ba1e338c..0bcd87cc309 100644
--- a/src/plugins/android/androidpackageinstallationstep.cpp
+++ b/src/plugins/android/androidpackageinstallationstep.cpp
@@ -38,14 +38,22 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
+#include <qtsupport/baseqtversion.h>
+#include <qtsupport/qtkitinformation.h>
+
#include <utils/hostosinfo.h>
#include <utils/qtcprocess.h>
#include <QDir>
+#include <QLoggingCategory>
using namespace ProjectExplorer;
using namespace Utils;
+namespace {
+static Q_LOGGING_CATEGORY(packageInstallationStepLog, "qtc.android.packageinstallationstep", QtWarningMsg)
+}
+
namespace Android {
namespace Internal {
@@ -153,6 +161,26 @@ void AndroidPackageInstallationStep::doRun()
}
}
AbstractProcessStep::doRun();
+
+ // NOTE: This is a workaround for QTCREATORBUG-24155
+ // Needed for Qt 5.15.0 and Qt 5.14.x versions
+ if (buildType() == BuildConfiguration::BuildType::Debug) {
+ QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(target()->kit());
+ if (version && version->qtVersion() >= QtSupport::QtVersionNumber{5, 14}
+ && version->qtVersion() <= QtSupport::QtVersionNumber{5, 15, 0}) {
+ const QString assetsDebugDir = nativeAndroidBuildPath().append(
+ "/assets/--Added-by-androiddeployqt--/");
+ QDir dir;
+ if (!dir.exists(assetsDebugDir))
+ dir.mkpath(assetsDebugDir);
+
+ QFile file(assetsDebugDir + "debugger.command");
+ if (file.open(QIODevice::WriteOnly))
+ qCDebug(packageInstallationStepLog, "Successful added %s to the package.", qPrintable(file.fileName()));
+ else
+ qCDebug(packageInstallationStepLog, "Cound't add %s to the package. The QML debugger might not work properly.", qPrintable(file.fileName()));
+ }
+ }
}
BuildStepConfigWidget *AndroidPackageInstallationStep::createConfigWidget()