首页 > 解决方案 > macdeployqt 破解应用

问题描述

我已经安装了 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

这一切都“成功”完成,但我的应用程序无法加载。如果我尝试从 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

有什么帮助吗?

谢谢!

标签: qtqmlqt-creatormacdeployqt

解决方案


该选项是应用程序源目录-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 文件,在该目录中找不到任何 QML 文件,因此不包含任何 QML 模块。


推荐阅读