【问题标题】:macdeployqt breaking appmacdeployqt 破解应用
【发布时间】:2018-10-07 05:32:59
【问题描述】:

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

有什么帮助吗?

谢谢!

【问题讨论】:

    标签: qt qml qt-creator macdeployqt


    【解决方案1】:

    -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 模块。

    【讨论】:

    • 您好,感谢您抽出宝贵时间。不幸的是,我无法使用 5.11.0 Qt 版本做任何事情。卸载并安装 5.10.0 版本后,一切正常。
    • 为我使用了 5.11 ?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-26
    • 2016-05-12
    • 1970-01-01
    • 2018-02-08
    • 2015-04-04
    • 2023-03-11
    相关资源
    最近更新 更多