Unsolved Mac OS X deployment
-
Hi all. I have deployed my program on Mac OS X 10.11, using next commands:
Qt/5.5/clang_64/bin/macdeployqt App.app npm install -g appdmg appdmg spec.json App.dmg
On my mac everything works fine. But users of the program facing the next problem due to start:
Application Specific Information: dyld: launch, loading dependent libraries Dyld Error Message: Library not loaded: @rpath/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets Referenced from: /Applications/VkJust.app/Contents/MacOS/VkJust Reason: image not found
Using otool, I see the next info:
@rpath/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets (compatibility version 5.5.0, current version 5.5.1) @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.5.0, current version 5.5.1) @rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.5.0, current version 5.5.1) @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.5.0, current version 5.5.1) /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) @rpath/QtWebKit.framework/Versions/5/QtWebKit (compatibility version 5.5.0, current version 5.5.1) @rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.5.0, current version 5.5.1) /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 120.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
-
Hi and welcome to devnet,
I'd recommend running macdeployqt with the verbose option enabled to check what happens regarding QtWebKit.
On a side note, you can generate the .dmg file directly with macdeployqt
-
@SGaist Hello, yes, I know about it, but I need a custom dmg image file.
I've ran macdeployqt with verbose option, and there are not any problems here.Log: Adding framework: Log: Framework name "QtWebKitWidgets.framework" Framework directory "/Users/alejandro/Qt/5.5/clang_64/lib/" Framework path "/Users/alejandro/Qt/5.5/clang_64/lib/QtWebKitWidgets.framework" Binary directory "Versions/5" Binary name "QtWebKitWidgets" Binary path "/Versions/5/QtWebKitWidgets" Version "5" Install name "/Users/alejandro/Qt/5.5/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets" Deployed install name "@executable_path/../Frameworks/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets" Source file Path "/Users/alejandro/Qt/5.5/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets" Framework Destination Directory (relative to bundle) "Contents/Frameworks/QtWebKitWidgets.framework" Binary Destination Directory (relative to bundle) "Contents/Frameworks/QtWebKitWidgets.framework/Versions/5"
-
Can you check the rpath from your executable ?
-
@SGaist What do you mean?
-
Call
otool -l
on your executable and check for the LD_RPATH values -
@SGaist It is the same like in first post:
@rpath/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets (compatibility version 5.5.0, current version 5.5.1) @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.5.0, current version 5.5.1) @rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.5.0, current version 5.5.1) @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.5.0, current version 5.5.1) /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) @rpath/QtWebKit.framework/Versions/5/QtWebKit (compatibility version 5.5.0, current version 5.5.1) @rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.5.0, current version 5.5.1) /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 120.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
-
@alejandro_pnz Did you run macdeployqt from the Qt install folder? I had the same problem when try to call macdeployqt command from the another folder. I will try to explain what i mean:
- I have a application in folder /Users/andrew/qt_projects/myapp/build
- Go to this folder with command: cd /Users/andrew/qt_projects/myapp/build
- In folder I call command qt_install_folder/5.7/clang_64/bin/macdeploy myapp.app
- In current folder I receive myapp.app with all needs libraries and frameworks. And if I run it on my mac it's works fine. But if this application will open on another mac the users will get the same error with framework (in my case it's QML plugin).
The solution for this it's run macdeployqt from the Qt install folder. You need to go to folder where is macdeplotqt binary file and run this command from there.
Another way it's configure QtCreator to run macdeploy command when you build your app. For this create a new Build step in Project settings. And add Custom Build Step where set next properties:
command: macdeployqt arguments: %{buildDir}/YouprojectName.app -qmldir=fullpath_to_qml_folder -always-overwrite -verbose=2 -codesign="3rd Party Mac Developer Application: Team Name" working folder: $QTDIR/bin
This configuration works for me. Please check the arguments for macdeploqt for your project.
I hope this will help to you.