2

我目前正在尝试在 MacOs 上部署我的 Qt5.8 应用程序。Travis 的最新工作在这里。使用后我得到了VNote.dmg文件macdeployqt。然后我将它复制到另一个MacOS并尝试运行它,但出现以下错误:

/Applications/VNote/VNote.app/Contents/MacOS/VNote ; exit;
dyld: Library not loaded: /usr/local/Cellar/qt5/5.8.0_1/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore
  Referenced from: /Applications/VNote/VNote.app/Contents/Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets
  Reason: image not found
Trace/BPT trap: 5
logout

然后我用来otool -L /Applications/VNote.app/Contents/MacOS/VNote获取输出:

/Applications/VNote.app/Contents/MacOS/VNote:
    @executable_path/../Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0)
    /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    @executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.8.0, current version 5.8.0)
    @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

然后otool -L /Applications/VNote.app/Contents/Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets显示:

/Applications/VNote.app/Contents/Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets:
    @executable_path/../Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0)
    /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtQml.framework/Versions/5/QtQml (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0)
    /usr/local/Cellar/qt5/5.8.0_1/lib/QtQuickWidgets.framework/Versions/5/QtQuickWidgets (compatibility version 5.8.0, current version 5.8.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

QtWebEngineWidgets似乎仍然引用 Travis env 上的绝对路径。

我应该怎么做才能部署 Qt 应用程序?非常感谢!

4

1 回答 1

2

我认为这是macdeployqt. 它似乎没有解决所有框架的依赖关系。相反,它只是修复了可执行文件的直接依赖关系。

感谢macdeployqtfix,它是一个工具来完成所有macdeployqt忘记的事情。

顺便说一句,如果您的应用程序使用QWebEngineWidget,您也需要macdeployqt帮助程序QWebEngineProcess包。

于 2017-03-16T02:05:38.157 回答