From 8c016f05ebd8000d235e12734d1d89998e431908 Mon Sep 17 00:00:00 2001 From: Sebastian Streich Date: Wed, 31 Aug 2022 13:04:25 +0200 Subject: [PATCH] Skip QmlImport scanner if the ABI is not present --- android/buildSrc/src/main/kotlin/QtConfig.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/android/buildSrc/src/main/kotlin/QtConfig.kt b/android/buildSrc/src/main/kotlin/QtConfig.kt index 7cf008d21d..f81c860a57 100644 --- a/android/buildSrc/src/main/kotlin/QtConfig.kt +++ b/android/buildSrc/src/main/kotlin/QtConfig.kt @@ -169,6 +169,9 @@ open class QTConfigurationExtension // Runs QMLImportscanner from qt_host against the // qt_android_ folder, to find out what we need to bundle for qml private fun getQMLImports(abi: String): JSONArray { + if (abi.isEmpty()) { + return JSONArray() + } val importScanner = File("$host/libexec/qmlimportscanner") if (!importScanner.exists()) { error("Did not found qmlimportscanner in $host/libexec/qmlimportscanner") @@ -179,6 +182,7 @@ open class QTConfigurationExtension if (!qmlPath.exists()) { return JSONArray() } + print("Calling: $importScanner -rootPath $qmlPath -importPath $qtQMLPath") val process = Runtime.getRuntime().exec("$importScanner -rootPath $qmlPath -importPath $qtQMLPath") val processOutput = StringBuilder() @@ -192,7 +196,13 @@ open class QTConfigurationExtension } process.waitFor() } - return JSONArray(processOutput.toString()) + val out = processOutput.toString(); + try{ + return JSONArray(out) + }catch(e:Exception){ + error("Got Output of: $out \n ${e.toString()}") + + } } companion object {