xcodeqtqmlotoolmacdeployqt

segmentation fault when running macdeployqt


In order to run my Qt app on another Mac, I have the following two lines in my .pro file

MACDEPLOY = `echo $$QMAKE_QMAKE | sed 's/qmake/macdeployqt/g'` 
QMAKE_POST_LINK = $$MACDEPLOY $$OUT_PWD/$$TARGET\.app -qmldir=$$PWD -verbose=3

This works fine for a simple HelloWorld application. It used to work fine for my 'real' application as well but now I get the following error (my application works fine on my local Mac without these two lines)

/Users/marc/Qt5.7/5.7/clang_64/bin/macdeployqt /Users/marc/workspaceZ2/build/build-Z2Nexx40-Desktop_Qt_5_7_0_clang_64bit-Release/Z2Nexx40\.app -qmldir=/Users/marc/workspaceZ2/Z2Nexx40 -verbose=3
ERROR: Could not find bundle binary for "/Users/marc/workspaceZ2/build/build-Z2Nexx40-Desktop_Qt_5_7_0_clang_64bit-Release/Z2Nexx40.app" 
ERROR: "error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file:  (No such file or directory)\n" 
Log: Using otool: 
Log:  inspecting "" 
ERROR: "error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file:  (No such file or directory)\n" make: *** [Z2Nexx40.app/Contents/MacOS/Z2Nexx40] 
Segmentation fault: 11 make:

And in the problem report window that pops up I see (not sure whether I picked a relevant part of it though)

Binary Images:
       0x10da98000 -        0x10dac4fff +macdeployqt (0) <46011DBB-126C-35A0-942A-ACD79B0BCC45> /Users/USER/*/macdeployqt
       0x10dace000 -        0x10df2eff7 +org.qt-project.QtGui (5.7 - 5.7.0) <A41CBDE5-2955-3A57-BAE9-69001B210588> /Users/USER/*/QtGui.framework/Versions/5/QtGui
       0x10e081000 -        0x10e595ff7 +org.qt-project.QtCore (5.7 - 5.7.0) <5F2F454C-CEE8-3E59-A3B7-94F51F5B9F96> /Users/USER/*/QtCore.framework/Versions/5/QtCore
       0x10e6b2000 -        0x10e6b6fff  com.apple.agl (3.3.1 - AGL-3.3.1) <4E401980-0F4F-33E2-A0CF-8C7CCF375F24> /System/Library/Frameworks/AGL.framework/Versions/A/AGL
    0x7fff64f70000 -     0x7fff64fa7a47  dyld (360.22) <DC81CC9D-651A-3A45-8809-928282052BD3> /usr/lib/dyld

Any ideas what might be wrong here? I recently upgraded to XCode 8 (and downgraded again to 7.3), upgraded from Qt5.6 to 5.7 but I have no clue on how to proceed.

Tips on what I could try would be most helpful!


Solution

  • Apparently, the reason was an incorrect/incompatible plist file. I had to add a key to the plist file and hence I had my own plist file in my code tree.

    Probably after upgrading XCode, my OS or Qt, this plist file was not compatible anymore.

    I removed my own plist file, rebuild, and added my key to the newly generated plist file and everything worked fine as before.