macdeployqt 破坏应用程序

macdeployqt breaking app

我已经安装了Qt creator 5.11.0,

然后我更改了一些我需要更改的旧项目,当我尝试构建它时,它按预期工作,但在使用 macdeployqt 后,我​​的应用程序无法加载。

所以,当我 运行 macdeployqt 这样时:

./macdeployqt /Users/`MY_USERNAME`/Downloads/build-`MY_PROJECT_NAME`-Desktop_Qt_5_11_0_clang_64bit-Release/`MY_PROJECT_NAME`.app -qmldir=/Users/`MY_USERNAME`/Downloads/build-`MY_PROJECT_NAME`-Desktop_Qt_5_11_0_clang_64bit-Release/ -dmg -verbose=3

全部完成 'successfully',但我的应用程序无法加载。 如果我尝试从 QtCreator 运行 它输出这个

qrc:/main.qml:1 module "QtQuick" is not installed

qrc:/main.qml:4 module "QtGraphicalEffects" is not installed

qrc:/main.qml:2 module "QtQuick.Window" is not installed

qrc:/main.qml:3 module "QtQuick.Controls" is not installed

qrc:/main.qml:1 module "QtQuick" is not installed

qrc:/main.qml:4 module "QtGraphicalEffects" is not installed

qrc:/main.qml:2 module "QtQuick.Window" is not installed

qrc:/main.qml:3 module "QtQuick.Controls" is not installed

qrc:/main.qml:1 module "QtQuick" is not installed

qrc:/main.qml:4 module "QtGraphicalEffects" is not installed

qrc:/main.qml:2 module "QtQuick.Window" is not installed

qrc:/main.qml:3 module "QtQuick.Controls" is not installed

qrc:/main.qml:1 module "QtQuick" is not installed

qrc:/main.qml:4 module "QtGraphicalEffects" is not installed

qrc:/main.qml:2 module "QtQuick.Window" is not installed

qrc:/main.qml:3 module "QtQuick.Controls" is not installed

有什么帮助吗?

谢谢!

-qmldir 选项是应用 源目录 中 QML 文件的路径。尝试 运行 像这样(假设 -qmldir 的参数是应用程序源目录的路径):

./macdeployqt \
    /Users/`MY_USERNAME`/Downloads/build-`MY_PROJECT_NAME`-Desktop_Qt_5_11_0_clang_64bit-Release/`MY_PROJECT_NAME`.app \
    -qmldir=/Users/`MY_USERNAME`/Downloads/`MY_PROJECT_NAME`/ \
    -dmg -verbose=3

否则,该工具将在构建目录中搜索 QML 文件,它将在其中找到 none,因此不会包含任何 QML 模块。