Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Program won't start on macOS when using the .app
Forum Updated to NodeBB v4.3 + New Features

Program won't start on macOS when using the .app

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 6 Posters 3.6k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PatrickKox
    wrote on 27 Sept 2021, 19:14 last edited by
    #1

    Hi all,

    I've written a program on my Linux system and it works fine from there, now I've copied my code to an old macbook air and used it to build the mac version on it.

    I can start the program from QtCreator or manually from application.app/Contents/MacOS/application but when I double-click the App that was created it doesn't work. There is some feedback from the bar as if it's trying to open the application but then stops.

    There is no error message or anything.
    The installed version of macOS is BigSur and I'm using Qt 6.1.3

    Can anybody help me solve this problem?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 27 Sept 2021, 21:11 last edited by
      #2

      Hi and welcome to devnet,

      Is it a command line tool or a GUI ?
      Are you using widgets or QtQuick ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        PatrickKox
        wrote on 28 Sept 2021, 13:36 last edited by
        #3

        It's a GUI app (with some logging to the console) and it uses Widgets

        A 1 Reply Last reply 28 Sept 2021, 13:54
        0
        • P PatrickKox
          28 Sept 2021, 13:36

          It's a GUI app (with some logging to the console) and it uses Widgets

          A Offline
          A Offline
          artwaw
          wrote on 28 Sept 2021, 13:54 last edited by
          #4

          @PatrickKox The most important things:

          • did you run macdeployqt on the .app package?
          • did you sign the package in any way?
          • is this faulty behaviour on your dev machine (with Xcode and such) or on unrelated one?

          For more information please re-read.

          Kind Regards,
          Artur

          P 1 Reply Last reply 28 Sept 2021, 14:01
          0
          • A artwaw
            28 Sept 2021, 13:54

            @PatrickKox The most important things:

            • did you run macdeployqt on the .app package?
            • did you sign the package in any way?
            • is this faulty behaviour on your dev machine (with Xcode and such) or on unrelated one?
            P Offline
            P Offline
            PatrickKox
            wrote on 28 Sept 2021, 14:01 last edited by
            #5

            @artwaw

            1. Yes, I ran macdeployqt appname.app -dmg
            2. No, I don't even know how to do that
            3. This is on my dev machine (I have no other mac device to test)
            A 1 Reply Last reply 28 Sept 2021, 14:05
            0
            • P PatrickKox
              28 Sept 2021, 14:01

              @artwaw

              1. Yes, I ran macdeployqt appname.app -dmg
              2. No, I don't even know how to do that
              3. This is on my dev machine (I have no other mac device to test)
              A Offline
              A Offline
              artwaw
              wrote on 28 Sept 2021, 14:05 last edited by
              #6

              @PatrickKox can paste your .pro file here please?

              For more information please re-read.

              Kind Regards,
              Artur

              P 1 Reply Last reply 28 Sept 2021, 16:06
              0
              • M Offline
                M Offline
                mpergand
                wrote on 28 Sept 2021, 14:40 last edited by mpergand
                #7

                @PatrickKox said in Program won't start on macOS when using the .app:

                I can start the program from QtCreator or manually from application.app/Contents/MacOS/application but when I double-click the App that was created it doesn't work.

                Launch the Console app in the Utility folder.
                Double-click on your app on the Desktop.
                Look at any messages relative to your app in the Console window.

                1 Reply Last reply
                0
                • A artwaw
                  28 Sept 2021, 14:05

                  @PatrickKox can paste your .pro file here please?

                  P Offline
                  P Offline
                  PatrickKox
                  wrote on 28 Sept 2021, 16:06 last edited by
                  #8

                  @artwaw
                  QT += core gui sql charts

                  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                  CONFIG += c++11

                  //# You can make your code fail to compile if it uses deprecated APIs.
                  //# In order to do so, uncomment the following line.
                  DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

                  SOURCES +=
                  Hoofdpijnen.cpp
                  allehoofdpijnaanvallen.cpp
                  ernstgrafiek.cpp
                  gebruikersgegevens.cpp
                  help.cpp
                  hoofdpijntoevoegen.cpp
                  initializeDB.cpp
                  main.cpp
                  mainwindow.cpp
                  over.cpp
                  recentehoofdpijnaanvallen.cpp
                  symptomengrafiek.cpp

                  HEADERS +=
                  Hoofdpijnen.h
                  allehoofdpijnaanvallen.h
                  ernstgrafiek.h
                  gebruikersgegevens.h
                  help.h
                  hoofdpijntoevoegen.h
                  initializeDB.h
                  mainwindow.h
                  over.h
                  recentehoofdpijnaanvallen.h
                  symptomengrafiek.h

                  FORMS +=
                  allehoofdpijnaanvallen.ui
                  ernstgrafiek.ui
                  gebruikersgegevens.ui
                  help.ui
                  hoofdpijntoevoegen.ui
                  mainwindow.ui
                  over.ui
                  recentehoofdpijnaanvallen.ui
                  symptomengrafiek.ui

                  TRANSLATIONS +=
                  HoofdpijnAgenda_nl_BE.ts
                  HoofdpijnAgenda_nl_NL.ts
                  HoofdpijnAgenda_en_US.ts
                  HoofdpijnAgenda_en_GB.ts
                  CONFIG += lrelease
                  CONFIG += embed_translations

                  //# Default rules for deployment.
                  qnx: target.path = /tmp/$${TARGET}/bin
                  else: unix:!android: target.path = /opt/$${TARGET}/bin
                  !isEmpty(target.path): INSTALLS += target

                  DISTFILES +=
                  HoofdpijnAgenda_en_US.ts
                  HoofdpijnAgenda_nl_BE.ts

                  RESOURCES +=
                  Resources.qrc

                  A 1 Reply Last reply 28 Sept 2021, 16:29
                  0
                  • P PatrickKox
                    28 Sept 2021, 16:06

                    @artwaw
                    QT += core gui sql charts

                    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                    CONFIG += c++11

                    //# You can make your code fail to compile if it uses deprecated APIs.
                    //# In order to do so, uncomment the following line.
                    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

                    SOURCES +=
                    Hoofdpijnen.cpp
                    allehoofdpijnaanvallen.cpp
                    ernstgrafiek.cpp
                    gebruikersgegevens.cpp
                    help.cpp
                    hoofdpijntoevoegen.cpp
                    initializeDB.cpp
                    main.cpp
                    mainwindow.cpp
                    over.cpp
                    recentehoofdpijnaanvallen.cpp
                    symptomengrafiek.cpp

                    HEADERS +=
                    Hoofdpijnen.h
                    allehoofdpijnaanvallen.h
                    ernstgrafiek.h
                    gebruikersgegevens.h
                    help.h
                    hoofdpijntoevoegen.h
                    initializeDB.h
                    mainwindow.h
                    over.h
                    recentehoofdpijnaanvallen.h
                    symptomengrafiek.h

                    FORMS +=
                    allehoofdpijnaanvallen.ui
                    ernstgrafiek.ui
                    gebruikersgegevens.ui
                    help.ui
                    hoofdpijntoevoegen.ui
                    mainwindow.ui
                    over.ui
                    recentehoofdpijnaanvallen.ui
                    symptomengrafiek.ui

                    TRANSLATIONS +=
                    HoofdpijnAgenda_nl_BE.ts
                    HoofdpijnAgenda_nl_NL.ts
                    HoofdpijnAgenda_en_US.ts
                    HoofdpijnAgenda_en_GB.ts
                    CONFIG += lrelease
                    CONFIG += embed_translations

                    //# Default rules for deployment.
                    qnx: target.path = /tmp/$${TARGET}/bin
                    else: unix:!android: target.path = /opt/$${TARGET}/bin
                    !isEmpty(target.path): INSTALLS += target

                    DISTFILES +=
                    HoofdpijnAgenda_en_US.ts
                    HoofdpijnAgenda_nl_BE.ts

                    RESOURCES +=
                    Resources.qrc

                    A Offline
                    A Offline
                    artwaw
                    wrote on 28 Sept 2021, 16:29 last edited by
                    #9

                    @PatrickKox said in Program won't start on macOS when using the .app:

                    core gui sql charts

                    You should enter the app bundle (using either Finder or console tool, like Midnight Commander) and verify, if in Framework folder all the dependencies are present.
                    Also, running macdeployqt app_name -verbose=3 -always-overwrite and examining the log might help identify the problems - maybe something is not copied properly?

                    Running otool -L app_bundlename.app/Contents/MacOS/app_name will give you a list of the first step dependencies - those are honoured by macdeployqt.
                    Second level dependencies are not (if you run anything using Postgres SQL I pity you already), running otool on those libraries will give you their dependencies...

                    Also, setting the environment variable export DYLD_PRINT_LIBRARIES_POST_LAUNCH=1 will print you what is loaded and when.

                    For more information please re-read.

                    Kind Regards,
                    Artur

                    1 Reply Last reply
                    1
                    • P Offline
                      P Offline
                      PatrickKox
                      wrote on 28 Sept 2021, 18:07 last edited by
                      #10

                      The dependencies for GUI, SQL (I use SQLite3 not Postgres SQL), Widget, Core, Chart and some others are inside the Framework directory.

                      The output from macdeployqy with -verbose=3 is huge, so I'll look into that during the weekend when I have more time.

                      But when I run using the export CYLD_PRINT_LIBRARIES_POST_LAUNCH=1 option, I notice several libraries are loaded from /System and not the app folder:

                      $ ./HoofdpijnAgenda 
                      dyld: loaded: <CDEE5153-12AA-3A16-9077-D54E0733DB25> /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal
                      dyld: loaded: <561E6824-17F0-313C-B470-00FD08F0C8DD> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/platforms/libqcocoa.dylib
                      dyld: loaded: <FEFBAFBF-EE76-3E63-84CA-95E5F1F26805> /usr/lib/libobjc-trampolines.dylib
                      dyld: loaded: <87F799AF-A8B9-31FB-9885-7EBDAEBCECC3> /System/Library/Frameworks/FileProvider.framework/Versions/A/FileProvider
                      dyld: loaded: <D3091C11-4823-34D7-829D-DBA3C7616DE1> /System/Library/Frameworks/Accounts.framework/Versions/A/Accounts
                      dyld: loaded: <623FEAF8-671F-3812-9EA4-7B30FFC4AE7D> /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage
                      dyld: loaded: <CE5694DC-0351-3F11-8850-19A9AB721893> /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication
                      dyld: loaded: <DC724AF6-1C92-3913-B6A7-0AA062AE1792> /System/Library/PrivateFrameworks/SymptomDiagnosticReporter.framework/Versions/A/SymptomDiagnosticReporter
                      dyld: loaded: <FD2F7A55-6308-3495-BC07-A74DDB8F57C9> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
                      dyld: loaded: <37533D5B-1AC4-3E2F-B29B-F33D0C463F49> /usr/lib/libsandbox.1.dylib
                      dyld: loaded: <209049A9-BA50-336B-B43E-050998B5E33D> /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement
                      dyld: loaded: <DAEF912D-F2E6-34E7-B93C-708A6CCE0F7E> /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag
                      dyld: loaded: <95D77D1F-5373-3C85-BA2A-48923BA260FA> /System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary
                      dyld: loaded: <A0FA2F40-271B-3CC7-8083-A34E21093536> /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
                      dyld: loaded: <D3B2F86B-1440-3F86-863D-521EFB5E6BF8> /System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing
                      dyld: loaded: <E1BB392A-D496-383C-9B5A-08D695D14FD9> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
                      dyld: loaded: <92FFE128-151C-33EB-9179-234F9F976F32> /System/Library/PrivateFrameworks/AuthKit.framework/Versions/A/AuthKit
                      dyld: loaded: <5B68EF6B-DE46-36B1-8928-111D92C948CD> /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils
                      dyld: loaded: <17C7352E-2EF3-36BE-8BF9-B9AF2541B02D> /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN
                      dyld: loaded: <E5F9D822-9999-3521-A812-6ED6E4B4F7C3> /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth
                      dyld: loaded: <30F0EC33-A723-3637-BAEE-746E62173413> /System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi
                      dyld: loaded: <16382BEE-19B6-3AE5-B450-D037B7D7C19F> /System/Library/PrivateFrameworks/CorePhoneNumbers.framework/Versions/A/CorePhoneNumbers
                      dyld: loaded: <2D63F3D0-8E51-3337-8EB7-A774020B129C> /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement
                      dyld: loaded: <A3631052-9D44-308F-BF87-E501AB409692> /System/Library/PrivateFrameworks/AppleIDAuthSupport.framework/Versions/A/AppleIDAuthSupport
                      dyld: loaded: <B1E75E61-0B7E-3036-931E-4D0C8E6307FC> /System/Library/PrivateFrameworks/KeychainCircle.framework/Versions/A/KeychainCircle
                      dyld: loaded: <5198B786-444D-3CA6-85AC-6555688B0DBC> /System/Library/PrivateFrameworks/MediaKit.framework/Versions/A/MediaKit
                      dyld: loaded: <367204EF-650E-36BE-8D0F-9DF6E79E5DB0> /System/Library/Frameworks/DiscRecording.framework/Versions/A/DiscRecording
                      dyld: loaded: <D84C72BA-171F-37D1-9099-294DF04347A2> /usr/lib/libCoreStorage.dylib
                      dyld: loaded: <7D24C26A-8165-33ED-8255-43B52148CD29> /usr/lib/libcsfde.dylib
                      dyld: loaded: <87EAE8D8-A80C-3BE3-87EF-A1AA20876D7F> /System/Library/PrivateFrameworks/ProtectedCloudStorage.framework/Versions/A/ProtectedCloudStorage
                      dyld: loaded: <B6D754F1-9575-3000-BF81-55B0B7A83804> /System/Library/PrivateFrameworks/EFILogin.framework/Versions/A/EFILogin
                      dyld: loaded: <097C1991-EEC4-374E-A686-826E479A2A07> /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
                      dyld: loaded: <1A427F92-B95A-3077-853B-09688553DA70> /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth
                      dyld: loaded: <0391A7F9-5CAD-399A-92E4-5B1A4A2DED43> /usr/lib/libMatch.1.dylib
                      dyld: loaded: <D5D0AD69-E651-3BE2-B87A-4A035DCD9DBF> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/Libraries/libCGInterfaces.dylib
                      dyld: loaded: <8A59B9FA-55F7-325B-9801-88342C26A8D7> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/styles/libqmacstyle.dylib
                      dyld: loaded: <B18084DB-3288-345F-8E7E-A157971C196B> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
                      Databestand hoofdpijnen.sqlite3 geopend.
                      QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
                      dyld: loaded: <A1880566-53BD-3F97-8F4A-0D8B5D04FC8F> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/imageformats/libqjpeg.dylib
                      dyld: loaded: <6FD6B5FC-A78E-357E-8CDB-69D06595B0BE> /System/Library/PrivateFrameworks/login.framework/Versions/A/login
                      Databestand hoofdpijnen.sqlite3 geopend.
                      dyld: loaded: <E03494F6-D023-376D-8177-7600A8CF6873> /System/Library/PrivateFrameworks/ViewBridge.framework/Versions/A/ViewBridge
                      dyld: loaded: <D700B323-61F9-35B6-83DC-4D272DAFEB50> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport
                      dyld: loaded: <B1623916-5735-37BC-B424-0EFAD8662D74> /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics
                      dyld: loaded: <A7FFAFB5-B0AB-312E-8EB6-FAF56D76FB7D> /usr/lib/libRosetta.dylib
                      dyld: loaded: <42D309FD-1717-3D9C-A5F7-EE9FAF163162> /System/Library/PrivateFrameworks/RemoteServiceDiscovery.framework/Versions/A/RemoteServiceDiscovery
                      dyld: loaded: <3A006E5D-FE72-3D34-B887-4EF7824B5A4B> /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication
                      dyld: loaded: <BBD3F65B-90E9-3107-A8E8-81D708226D26> /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging
                      dyld: loaded: <06BB02D5-50F4-359B-AA41-42D08FE267CD> /System/Library/PrivateFrameworks/AccessibilityBundles.framework/Versions/A/AccessibilityBundles
                      dyld: unloaded: <A1880566-53BD-3F97-8F4A-0D8B5D04FC8F> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/imageformats/libqjpeg.dylib
                      dyld: unloaded: <561E6824-17F0-313C-B470-00FD08F0C8DD> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/platforms/libqcocoa.dylib
                      dyld: unloaded: <B18084DB-3288-345F-8E7E-A157971C196B> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
                      dyld: unloaded: <8A59B9FA-55F7-325B-9801-88342C26A8D7> /Users/patrickkox/Documents/GitHub/Hoofdpijn-Agenda/build-HoofdpijnAgenda-Qt_6_1_3_for_macOS-Release/HoofdpijnAgenda.app/Contents/PlugIns/styles/libqmacstyle.dylib
                      
                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        artwaw
                        wrote on 28 Sept 2021, 18:12 last edited by
                        #11

                        Loading from /System is ok, that's where some system parts are (like c:\Windows\system32).

                        Silly question but does your program run from QtCreator on Mac? Preferably in debug mode?

                        For more information please re-read.

                        Kind Regards,
                        Artur

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          PatrickKox
                          wrote on 28 Sept 2021, 18:33 last edited by
                          #12

                          Yes, It runs perfectly from QtCreator on mac (both the debug and release versions), in fact that's how I build the program on my mac.

                          A 1 Reply Last reply 28 Sept 2021, 18:41
                          0
                          • P PatrickKox
                            28 Sept 2021, 18:33

                            Yes, It runs perfectly from QtCreator on mac (both the debug and release versions), in fact that's how I build the program on my mac.

                            A Offline
                            A Offline
                            artwaw
                            wrote on 28 Sept 2021, 18:41 last edited by
                            #13

                            @PatrickKox I thought so much...

                            It is absolutely odd, if the program would crash you should see system info that it crashed, with lots of data about it (often also with name of the method that caused the crash). When I think of it, this should also happen when one of the libraries is missing. Unless it is not crucial library...

                            Simple way would be to put log messages into routines on entry, for example, that would log to the text file - this could give you at least some idea about where it dies. I think in the worst case you can log to the system console and then search through it but that's tedious work.

                            For more information please re-read.

                            Kind Regards,
                            Artur

                            P 1 Reply Last reply 28 Sept 2021, 19:05
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 28 Sept 2021, 19:05 last edited by
                              #14

                              Do you get the same issue with a default widget application ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              P 1 Reply Last reply 28 Sept 2021, 19:15
                              0
                              • A artwaw
                                28 Sept 2021, 18:41

                                @PatrickKox I thought so much...

                                It is absolutely odd, if the program would crash you should see system info that it crashed, with lots of data about it (often also with name of the method that caused the crash). When I think of it, this should also happen when one of the libraries is missing. Unless it is not crucial library...

                                Simple way would be to put log messages into routines on entry, for example, that would log to the text file - this could give you at least some idea about where it dies. I think in the worst case you can log to the system console and then search through it but that's tedious work.

                                P Offline
                                P Offline
                                PatrickKox
                                wrote on 28 Sept 2021, 19:05 last edited by
                                #15

                                @artwaw

                                How would I start it from the console?
                                When I manually start it from application.app/Contents/MacOS/Application it runs fine.

                                and when I double click or open from the filemanager the icon starts bouncing for a few seconds and nothing happens.

                                The only way I can start from the GUI, is by right-clicking and selecting Show Package Content, and double click the executable in the Contents/MacOS directory.

                                Could this indicate that macOS for some reason doesn't know what it must execute when I double-click the .app in Finder?

                                A 2 Replies Last reply 28 Sept 2021, 19:11
                                0
                                • P PatrickKox
                                  28 Sept 2021, 19:05

                                  @artwaw

                                  How would I start it from the console?
                                  When I manually start it from application.app/Contents/MacOS/Application it runs fine.

                                  and when I double click or open from the filemanager the icon starts bouncing for a few seconds and nothing happens.

                                  The only way I can start from the GUI, is by right-clicking and selecting Show Package Content, and double click the executable in the Contents/MacOS directory.

                                  Could this indicate that macOS for some reason doesn't know what it must execute when I double-click the .app in Finder?

                                  A Offline
                                  A Offline
                                  artwaw
                                  wrote on 28 Sept 2021, 19:11 last edited by
                                  #16

                                  @PatrickKox No no, I meant the Console, system application showing logs and stuff (cmd+space, "console"). I believe srterr ends up there, when you use system log. But I find it too troublesome to filter through stuff in it, so I just write to text file. It is lame but it works.

                                  For more information please re-read.

                                  Kind Regards,
                                  Artur

                                  P 1 Reply Last reply 28 Sept 2021, 19:25
                                  0
                                  • P PatrickKox
                                    28 Sept 2021, 19:05

                                    @artwaw

                                    How would I start it from the console?
                                    When I manually start it from application.app/Contents/MacOS/Application it runs fine.

                                    and when I double click or open from the filemanager the icon starts bouncing for a few seconds and nothing happens.

                                    The only way I can start from the GUI, is by right-clicking and selecting Show Package Content, and double click the executable in the Contents/MacOS directory.

                                    Could this indicate that macOS for some reason doesn't know what it must execute when I double-click the .app in Finder?

                                    A Offline
                                    A Offline
                                    artwaw
                                    wrote on 28 Sept 2021, 19:14 last edited by
                                    #17

                                    @PatrickKox Additionally, it might be gatekeeper stopping you from running unsigned code (that's the reason I asked do you sign the bundle).
                                    But on dev machine it should work, problem starts when you distribute the bundle. After you run it and it dies check system preferences -> security and privacy -> tab "general". It might be that there is an option where you have to allow this bundle to run (but gatekeeper should also display a warning and notification that you run "potentially dangerous code").

                                    For more information please re-read.

                                    Kind Regards,
                                    Artur

                                    1 Reply Last reply
                                    0
                                    • S SGaist
                                      28 Sept 2021, 19:05

                                      Do you get the same issue with a default widget application ?

                                      P Offline
                                      P Offline
                                      PatrickKox
                                      wrote on 28 Sept 2021, 19:15 last edited by
                                      #18

                                      @SGaist
                                      No, a blank Widget app works without any problem.

                                      1 Reply Last reply
                                      0
                                      • A artwaw
                                        28 Sept 2021, 19:11

                                        @PatrickKox No no, I meant the Console, system application showing logs and stuff (cmd+space, "console"). I believe srterr ends up there, when you use system log. But I find it too troublesome to filter through stuff in it, so I just write to text file. It is lame but it works.

                                        P Offline
                                        P Offline
                                        PatrickKox
                                        wrote on 28 Sept 2021, 19:25 last edited by PatrickKox
                                        #19

                                        @artwaw
                                        Ah, Sorry I thought you were talking about the terminal (since some people also refer to it as the console).

                                        Anyway, It seems to give a SegFault when I start it.

                                        Process:               HoofdpijnAgenda [5166]
                                        Path:                  /Volumes/*/HoofdpijnAgenda.app/Contents/MacOS/HoofdpijnAgenda
                                        Identifier:            com.yourcompany.HoofdpijnAgenda
                                        Version:               0
                                        Code Type:             X86-64 (Native)
                                        Parent Process:        bash [5160]
                                        Responsible:           Terminal [3369]
                                        User ID:               501
                                        
                                        Date/Time:             2021-09-27 20:57:19.111 +0200
                                        OS Version:            macOS 11.5.2 (20G95)
                                        Report Version:        12
                                        Anonymous UUID:        8E37DB9C-E5D3-B90F-44FA-F8CA1022523D
                                        
                                        Sleep/Wake UUID:       D133E950-78B6-472C-A3AF-10A530D9F01D
                                        
                                        Time Awake Since Boot: 8100 seconds
                                        Time Since Wake:       5200 seconds
                                        
                                        System Integrity Protection: enabled
                                        
                                        Crashed Thread:        0  Dispatch queue: com.apple.main-thread
                                        
                                        Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
                                        Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
                                        Exception Note:        EXC_CORPSE_NOTIFY
                                        
                                        Termination Signal:    Segmentation fault: 11
                                        Termination Reason:    Namespace SIGNAL, Code 0xb
                                        Terminating Process:   exc handler [5166]
                                        

                                        But why does it work when started from QtCreator or the terminal?

                                        edit:
                                        wait... This is when it actually runs (Terminal and QtCreator), when I start from Finder, there is nothing added to Console (at least not to the crash reports)

                                        I do however see this

                                        Sep 28 21:27:47 Patricks-MacBook-Air com.apple.xpc.launchd[1] (application.com.yourcompany.HoofdpijnAgenda.12886989148.12886989233[16445]): Service exited with abnormal code: 1
                                        
                                        A 1 Reply Last reply 28 Sept 2021, 20:06
                                        0
                                        • P PatrickKox
                                          28 Sept 2021, 19:25

                                          @artwaw
                                          Ah, Sorry I thought you were talking about the terminal (since some people also refer to it as the console).

                                          Anyway, It seems to give a SegFault when I start it.

                                          Process:               HoofdpijnAgenda [5166]
                                          Path:                  /Volumes/*/HoofdpijnAgenda.app/Contents/MacOS/HoofdpijnAgenda
                                          Identifier:            com.yourcompany.HoofdpijnAgenda
                                          Version:               0
                                          Code Type:             X86-64 (Native)
                                          Parent Process:        bash [5160]
                                          Responsible:           Terminal [3369]
                                          User ID:               501
                                          
                                          Date/Time:             2021-09-27 20:57:19.111 +0200
                                          OS Version:            macOS 11.5.2 (20G95)
                                          Report Version:        12
                                          Anonymous UUID:        8E37DB9C-E5D3-B90F-44FA-F8CA1022523D
                                          
                                          Sleep/Wake UUID:       D133E950-78B6-472C-A3AF-10A530D9F01D
                                          
                                          Time Awake Since Boot: 8100 seconds
                                          Time Since Wake:       5200 seconds
                                          
                                          System Integrity Protection: enabled
                                          
                                          Crashed Thread:        0  Dispatch queue: com.apple.main-thread
                                          
                                          Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
                                          Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
                                          Exception Note:        EXC_CORPSE_NOTIFY
                                          
                                          Termination Signal:    Segmentation fault: 11
                                          Termination Reason:    Namespace SIGNAL, Code 0xb
                                          Terminating Process:   exc handler [5166]
                                          

                                          But why does it work when started from QtCreator or the terminal?

                                          edit:
                                          wait... This is when it actually runs (Terminal and QtCreator), when I start from Finder, there is nothing added to Console (at least not to the crash reports)

                                          I do however see this

                                          Sep 28 21:27:47 Patricks-MacBook-Air com.apple.xpc.launchd[1] (application.com.yourcompany.HoofdpijnAgenda.12886989148.12886989233[16445]): Service exited with abnormal code: 1
                                          
                                          A Offline
                                          A Offline
                                          artwaw
                                          wrote on 28 Sept 2021, 20:06 last edited by
                                          #20

                                          @PatrickKox said in Program won't start on macOS when using the .app:

                                          Exception Type: EXC_BAD_ACCESS (SIGSEGV)
                                          Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
                                          Exception Note: EXC_CORPSE_NOTIFY

                                          Termination Signal: Segmentation fault: 11
                                          Termination Reason: Namespace SIGNAL, Code 0xb
                                          Terminating Process: exc handler [5166]

                                          It does end with segfault.

                                          For more information please re-read.

                                          Kind Regards,
                                          Artur

                                          1 Reply Last reply
                                          0

                                          1/26

                                          27 Sept 2021, 19:14

                                          • Login

                                          • Login or register to search.
                                          1 out of 26
                                          • First post
                                            1/26
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved