我安装了Qt创建者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有什么帮助吗?
谢谢!
发布于 2018-04-26 18:20:22
-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模块。
https://stackoverflow.com/questions/50044308
复制相似问题