Deployment of Qt App on Mac - dmg file does not run on a different machine



  • Hi All,

    I am very new to Qt/QML. I have installed Qt 5.3.1 on my mac and wanted to package my application. Following the instructions given "here":http://qt-project.org/doc/qt-4.8/deployment-mac.html#the-mac-deployment-tool, I successfully created a disk image file (.dmg) with my application. I can open/install and run it on my machine and everything works fine. When we try to run the same file on a different machine and we are getting the following error.


    Process: freefalltower [1430]
    Path: /Volumes/VOLUME/freefalltower.app/Contents/MacOS/freefalltower
    Identifier: com.yourcompany.freefalltower
    Version: ???
    Code Type: X86-64 (Native)
    Parent Process: ??? [1]
    Responsible: freefalltower [1430]
    User ID: 502

    Date/Time: 2014-10-21 15:09:45.181 +0530
    OS Version: Mac OS X 10.10 (14A389)
    Report Version: 11
    Anonymous UUID: 31D92D41-30AE-30B2-3D04-18AA68F17C98

    Time Awake Since Boot: 650 seconds

    Crashed Thread: 0

    Exception Type: EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000

    Application Specific Information:
    dyld: launch, loading dependent libraries

    Dyld Error Message:
    Library not loaded: /Users/clmkimpo/Qt5.3.1/5.3/clang_64/lib/QtQuick.framework/Versions/5/QtQuick
    Referenced from: /Volumes/VOLUME/freefalltower.app/Contents/MacOS/freefalltower
    Reason: image not found

    Binary Images:
    0x7fff6c8e3000 - 0x7fff6c919837 dyld (353.2.1) <4696A982-1500-34EC-9777-1EF7A03E2659> /usr/lib/dyld

    Model: MacBookAir6,2, BootROM MBA61.0099.B16, 2 processors, Intel Core i7, 1.7 GHz, 8 GB, SMC 2.13f15
    Graphics: Intel HD Graphics 5000, Intel HD Graphics 5000, Built-In
    Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x02FE, -
    Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x02FE, -
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x117), Broadcom BCM43xx 1.0 (7.15.124.12.8)
    Bluetooth: Version 4.3.0f10 14890, 3 services, 19 devices, 1 incoming serial ports
    Network Service: Wi-Fi, AirPort, en0
    Serial ATA Device: APPLE SSD SM0256F, 251 GB
    USB Device: Internal Memory Card Reader
    USB Device: BRCM20702 Hub
    USB Device: Bluetooth USB Host Controller
    Thunderbolt Bus: MacBook Air, Apple Inc., 23.6


    I have used "macdeployqt" and "otool -L" commands but it still does not solve my problem.

    Can someone help me sort out this problem?

    Thank you,

    Clovea.



  • Hi, when you run "macdeployqt" did you specify the -qmldir switch? "Example here":http://stackoverflow.com/a/20903329/233402

    Also, could you post a "otool -L" on your freefalltower.app/Contents/MacOS/freefalltower app?



  • Hi,

    I have tried to add the qmldir flag in my "macdeployqt" command, it still does not work. Here is the output of my otool -L


    @executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.3.0, current version 5.3.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/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)


    Thank you,



  • Hmm the otool -L looks good, could you also open your .dmg file and do a "otool -L" on your app inside it, i.e. do a "cd /Volumes/VOLUME/..." etc.?



  • The output of the otool -L command is this:


    @executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.3.0, current version 5.3.1)
    @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.3.0, current version 5.3.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/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)



  • Lifetime Qt Champion

    Hi,

    Are you using any custom library ?



  • Yes, also you could try with making an empty Widgets app, do macdeployqt and make a .dmg of the Widgets app, and see if that .dmg unpacks and runs ok on your other machine.



  • The following works for me for a simple Qt app-

    go to build dir of your APPNAME, which is called build-APPNAME-Desktop_Qt_5_3_clang_64bit-Debug

    ~/Qt/5.3/clang_64/bin/macdeployqt APPNAME.app -dmg -qmldir=/Users/USERNAME/Qt/5.3/clang_64/qml -verbose=3

    this generated a APPNAME.dmg file which I was able to use on another MacBook.



  • Thank you Shantanu, your solution does work for me as well.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.