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. App crashes after deployment
Forum Updated to NodeBB v4.3 + New Features

App crashes after deployment

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 5 Posters 627 Views 4 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.
  • K Offline
    K Offline
    Kiovtorov
    wrote on last edited by
    #1

    Hello, I have a problem which I have 1 day to solve. I want to deploy my qml application to be able to run on a clean system. No matter the os. I have a windows computer and a macos laptop. on both platforms on a brand new project when I try to use windeployqt or macdeployqt the application crashes before it even starts. for macos I use this command

    boyankiovtorov@Boyans-MacBook-Air Qt_6_8_0_for_macOS-Release % macdeployqt appuntitled1.app -qmldir=/Users/boyankiovtorov/Documents/untitled1/build/Qt_6_8_0_for_macOS-Release/untitled1 -dmg
    

    Please do tell what I am doing wrong

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kiovtorov
      wrote on last edited by Kiovtorov
      #2

      I used a command which worked for my windows computer but on macos i still have issues

      boyankiovtorov@Boyans-MacBook-Air Qt_6_8_0_for_macOS-Release % macdeployqt appFinbank.app -qmldir=/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_0_for_macOS-Release/Finbank -dmg -verbose=1
      ERROR: Cannot resolve rpath "@rpath/QtHunspellInputMethod.framework/Versions/A/QtHunspellInputMethod"
      ERROR:  using QList("/Users/boyankiovtorov/Qt/6.8.0/macos/lib", "/Users/boyankiovtorov/Documents/lib")
      ERROR: Cannot resolve rpath "@rpath/QtHunspellInputMethod.framework/Versions/A/QtHunspellInputMethod"
      ERROR:  using QList("/Users/boyankiovtorov/Qt/6.8.0/macos/lib", "/Users/boyankiovtorov/Documents/lib")
      
      1 Reply Last reply
      0
      • I Offline
        I Offline
        IgKh
        wrote on last edited by
        #3

        It tells you that it can't find the library bundle QtHunspellInputMethod.framework. Double check that it is available in the Qt installation directory, I think it is part of the virtual keyboard module.

        Though, not sure how your *.app bundle even runs locally if that's the error from the deployment tool.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kiovtorov
          wrote on last edited by
          #4

          Screenshot 2025-03-08 at 19.12.00.png
          I have it installed. maybe i should copy it somewhere where it can find it?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kiovtorov
            wrote on last edited by
            #5

            The output says that the program can not find
            Qt PDF
            Qt Virtual Keyboard
            Qt Multimedia (as a dependency)

            boyankiovtorov@Boyans-MacBook-Air Release % macdeployqt appFinbank.app -qmldir=/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_2_for_macOS-Release/Release/Finbank -dmg -verbose=1
            ERROR: Cannot resolve rpath "@rpath/QtPdfQuick.framework/Versions/A/QtPdfQuick"
            ERROR:  using QList("/Users/boyankiovtorov/Qt/6.8.2/macos/lib", "/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_2_for_macOS-Release/lib")
            ERROR: Cannot resolve rpath "@rpath/QtPdf.framework/Versions/A/QtPdf"
            ERROR:  using QList("/Users/boyankiovtorov/Qt/6.8.2/macos/lib", "/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_2_for_macOS-Release/lib")
            ERROR: Cannot resolve rpath "@rpath/QtHunspellInputMethod.framework/Versions/A/QtHunspellInputMethod"
            ERROR:  using QList("/Users/boyankiovtorov/Qt/6.8.2/macos/lib", "/Users/boyankiovtorov/Documents/Finbank/lib")
            ERROR: Cannot resolve rpath "@rpath/QtHunspellInputMethod.framework/Versions/A/QtHunspellInputMethod"
            ERROR:  using QList("/Users/boyankiovtorov/Qt/6.8.2/macos/lib", "/Users/boyankiovtorov/Documents/Finbank/lib")
            ERROR: Cannot resolve rpath "@rpath/QtPdf.framework/Versions/A/QtPdf"
            ERROR:  using QList("/Users/boyankiovtorov/Qt/6.8.2/macos/lib", "/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_2_for_macOS-Release/Release/lib")
            

            and I confirmed it using otool

            boyankiovtorov@Boyans-MacBook-Air Qt_6_8_2_for_macOS-Release % otool -L appFinbank.app/Contents/MacOS/appFinbank  
            appFinbank.app/Contents/MacOS/appFinbank:
            	@rpath/QtMultimedia.framework/Versions/A/QtMultimedia (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtNetworkAuth.framework/Versions/A/QtNetworkAuth (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtSql.framework/Versions/A/QtSql (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtCharts.framework/Versions/A/QtCharts (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtQuickControls2.framework/Versions/A/QtQuickControls2 (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtOpenGLWidgets.framework/Versions/A/QtOpenGLWidgets (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtWidgets.framework/Versions/A/QtWidgets (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtQuick.framework/Versions/A/QtQuick (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtQmlMeta.framework/Versions/A/QtQmlMeta (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtQmlWorkerScript.framework/Versions/A/QtQmlWorkerScript (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtOpenGL.framework/Versions/A/QtOpenGL (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtGui.framework/Versions/A/QtGui (compatibility version 6.0.0, current version 6.8.2)
            	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
            	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2487.60.105)
            	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
            	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
            	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 343.19.0)
            	@rpath/QtQmlModels.framework/Versions/A/QtQmlModels (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtQml.framework/Versions/A/QtQml (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtNetwork.framework/Versions/A/QtNetwork (compatibility version 6.0.0, current version 6.8.2)
            	@rpath/QtCore.framework/Versions/A/QtCore (compatibility version 6.0.0, current version 6.8.2)
            	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
            	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
            	/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers (compatibility version 1.0.0, current version 709.0.0)
            	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1700.255.5)
            	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.120.2)
            

            looking at the qt maintencetool i can see that I have installed them all. Can anyone help?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              You can pass additional modules to include to macdeployqt. Add those that are missing currently.

              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
              • K Offline
                K Offline
                Kiovtorov
                wrote on last edited by
                #7

                Hi, could you clarify more. Should I try to copy them inside the app package something like

                cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtPdf.framework appFinbank.app/Contents/somewhere/
                cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtVirtualKeyboard.framework appFinbank.app/Contents/somewhere/
                cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtMultimedia.framework appFinbank.app/Contents/somewhere/
                

                or should i try to pass them inside the command of macdeploy
                chatgpt says the command should look something like this

                macdeployqt appFinbank.app \
                    -executable=appFinbank.app/Contents/MacOS/appFinbank \
                    -libpath=/Users/boyankiovtorov/Qt/6.8.2/macos/lib \
                    -dmg \
                    -verbose=1
                ``` but still no success.
                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Kiovtorov
                  wrote on last edited by
                  #8

                  I got to a point where I don't get any errors but the app still crashes when launched

                  boyankiovtorov@boyans-air Release % cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtPdf.framework appFinbank.app/Contents/Frameworks/
                  boyankiovtorov@boyans-air Release % cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtPdfQuick.framework appFinbank.app/Contents/Frameworks/
                  
                  boyankiovtorov@boyans-air Release % cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtHunspellInputMethod.framework appFinbank.app/Contents/Frameworks 
                  cp: /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtHunspellInputMethod.framework: No such file or directory
                  boyankiovtorov@boyans-air Release % cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/lib/QtVirtualKeyboard.framework appFinbank.app/Contents/Frameworks/   
                  boyankiovtorov@boyans-air Release % install_name_tool -add_rpath @executable_path/../Frameworks appFinbank.app/Contents/MacOS/appFinbank
                  boyankiovtorov@boyans-air Release % install_name_tool -change @rpath/QtPdf.framework/Versions/A/QtPdf @executable_path/../Frameworks/QtPdf.framework/Versions/A/QtPdf appFinbank.app/Contents/MacOS/appFinbank
                  boyankiovtorov@boyans-air Release % install_name_tool -change @rpath/QtPdfQuick.framework/Versions/A/QtPdfQuick @executable_path/../Frameworks/QtPdfQuick.framework/Versions/A/QtPdfQuick appFinbank.app/Contents/MacOS/appFinbank
                  boyankiovtorov@boyans-air Release % install_name_tool -change @rpath/QtVirtualKeyboard.framework/Versions/A/QtVirtualKeyboard \
                    @executable_path/../Frameworks/QtVirtualKeyboard.framework/Versions/A/QtVirtualKeyboard \
                    appFinbank.app/Contents/MacOS/appFinbank
                  boyankiovtorov@boyans-air Release % mkdir -p appFinbank.app/Contents/Resources/qml/QtQuick/
                  
                  boyankiovtorov@boyans-air Release % cp -R /Users/boyankiovtorov/Qt/6.8.2/macos/qml/QtQuick/VirtualKeyboard appFinbank.app/Contents/Resources/qml/QtQuick/
                  boyankiovtorov@boyans-air Release % macdeployqt appFinbank.app \
                    -qmldir=/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_2_for_macOS-Release/Release/Finbank \
                    -dmg -verbose=1
                  

                  what can I do to debug why is it crashing

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    Kiovtorov
                    wrote on last edited by
                    #9

                    I ran a debugger to check what is going on and it looks like the program needs "cocoa"?. Anyway it finds it but it doesn't link

                    (lldb) run
                    Process 70275 launched: '/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_2_for_macOS-Release/Release/appFinbank.app/Contents/MacOS/appFinbank' (arm64)
                    2025-03-09 13:25:17.057987+0200 appFinbank[70275:2518404] [qt.qpa.plugin] Could not load the Qt platform plugin "cocoa" in "" even though it was found.
                    2025-03-09 13:25:17.058169+0200 appFinbank[70275:2518404] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                    
                    Available platform plugins are: cocoa.
                    Process 70275 stopped
                    
                    jsulmJ 1 Reply Last reply
                    0
                    • K Kiovtorov

                      I ran a debugger to check what is going on and it looks like the program needs "cocoa"?. Anyway it finds it but it doesn't link

                      (lldb) run
                      Process 70275 launched: '/Users/boyankiovtorov/Documents/Finbank/build/Qt_6_8_2_for_macOS-Release/Release/appFinbank.app/Contents/MacOS/appFinbank' (arm64)
                      2025-03-09 13:25:17.057987+0200 appFinbank[70275:2518404] [qt.qpa.plugin] Could not load the Qt platform plugin "cocoa" in "" even though it was found.
                      2025-03-09 13:25:17.058169+0200 appFinbank[70275:2518404] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                      
                      Available platform plugins are: cocoa.
                      Process 70275 stopped
                      
                      jsulmJ Online
                      jsulmJ Online
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @Kiovtorov Set QT_DEBUG_PLUGINS env variable before starting your app to get more information.
                      See https://doc.qt.io/qt-6/debug.html

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • S Online
                        S Online
                        SimonSchroeder
                        wrote on last edited by
                        #11

                        Looks like now you copied QtPdf, QtPdfQuick and QtVirtualKeyboard. Do exactly the same for QtHunspellInputMethod.

                        1 Reply Last reply
                        0

                        • Login

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