簡體   English   中英

QML android 應用程序使用 QtQuick.Shapes,找不到模塊

[英]QML android application using QtQuick.Shapes, module not found

我有一個 Qt 5.12.9 qml android 應用程序。 它運行良好,但我必須在文件中“導入 QtQuick.Shapes 1.12”,並在執行時得到:

module "QtQuick.Shapes" plugin "qmlshapesplugin" not found

我很好地導入了 Quick 模塊,因為沒有任何抱怨,而且我的應用程序在沒有 Shapes 導入的情況下運行良好。 我認為形狀通常包含在快速模塊中。

所以我查看了我的 apk 中的.so 文件,而 libQt5QuickShapes.so 不在其中。 有像 libQt5QuickParticles.so、libQt5QuickTemplates2.so、...這樣的文件,我沒有在我的應用程序中明確導入,但沒有 shape.so 文件。

如何在我的應用程序中導入該形狀模塊等? 和其他模塊有區別嗎? 我認為 androiddeployqt 完成了這項工作,但顯然並非適用於所有模塊。

在我的 Qt 安裝中,我有以下文件:

./include/QtQuickShapes/5.12.9/QtQuickShapes/private/qquickshapesglobal_p.h
./include/QtQuickShapes/5.12.9/QtQuickShapes/private/qquickshapesoftwarerenderer_p.h
./include/QtQuickShapes/qquickshapesglobal.h
./include/QtQuickShapes/qtquickshapesversion.h
./mkspecs/modules/qt_lib_quickshapes_private.pri
./qml/QtQuick/Shapes/libqmlshapesplugin.so
./include/QtQuickShapes
./include/QtQuickShapes/5.12.9/QtQuickShapes
./include/QtQuickShapes/QtQuickShapes
./include/QtQuickShapes/QtQuickShapesDepends
./include/QtQuickShapes/QtQuickShapesVersion
./lib/libQt5QuickShapes.la
./lib/libQt5QuickShapes.prl
./lib/libQt5QuickShapes.so
./qml/QtQuick/Shapes

所以 Shapes 的文件似乎在那里。

編輯

在我的部署 output 中,我有:

Reading Android dependencies for Qt5Quick
Appending dependency from xml: qml/QtQuick/Shapes/libqmlshapesplugin.so
Appending dependency from xml: qml/QtQuick/Shapes/plugins.qmltypes
Appending dependency from xml: qml/QtQuick/Shapes/qmldir
-- Skipping /pathToQt/qml/QtQuick/Shapes/libqmlshapesplugin.so. It has unmet dependencies: lib/libQt5QuickShapes.so.
-- Copied /pathToBuildApkFolder/assets/--Added-by-androiddeployqt--/qml/QtQuick/Shapes/plugins.qmltypes
-- Copied /pathToBuildApkFolder/assets/--Added-by-androiddeployqt--/qml/QtQuick/Shapes/qmldir

這是否意味着缺少 libqmlshapesplugin 的某些依賴項(它具有未滿足的依賴項:lib/libQt5QuickShapes.so),因此未將其添加到 apk package 中? 但是 lib/libQt5QuickShapes.so 似乎與 Qt5.12.9 一起正確安裝。

事實上,我並沒有說我的項目不是用 QtCreator 開發的。 So I had to use an existing json file for android-project-deployment-settings.json, which is normally generated by Qt automatically, and contains a lot of properties for the project ( https://doc.qt.io/qt- 5/deployment-android.html#prerequisites-before-running-androiddeployqt ),我不知道。

我使用了我項目中的那個,它沒有更新。 更准確地說,財產

"qml-root-path": "@QML_ROOT_PATH@" //the path to my qml files

丟失了,所以 androiddeploy 命令沒有為我的應用程序部署所有模塊,而只部署了默認模塊。

所以我用該屬性更新了 json 文件,沒關系,找到了模塊“QtQuick.Shapes”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM