Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt 5.9.1 macdeployqt: could not find the Qt platform plugin cocoa
Forum Updated to NodeBB v4.3 + New Features

Qt 5.9.1 macdeployqt: could not find the Qt platform plugin cocoa

Scheduled Pinned Locked Moved Solved Installation and Deployment
6 Posts 2 Posters 3.9k Views
  • 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.
  • J Offline
    J Offline
    Jpraccio
    wrote on last edited by
    #1

    Hi all,
    I realize this has been asked many times, however I have not seen this specific problem nor have I gained any insight. So here it goes again.

    I have a release build that I bundled and then applied macdeployqt on. I can verify that the qt.conf has the line Plugins = PlugIns. I can verify that libqcocoa is installed in PlugIns/platforms in the bundle. I have set the environment variable QT_DEBUG_PLUGIN=1.

    When the app runs, according to the debug message, it looks in the <bundle>/Contents/MacOs/platforms directory for libqcocoa and fails.

    Any ideas of what to do with this?

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, it could be some .dll/dylib that's missing for libqcocoa.dylib to load correctly, for example if the QtPrintSupport framework dll is missing then you'll get that missing plugin cocoa error. You can check which dlls it needs using with otool, e.g. otool -L libqcocoa.dylib

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jpraccio
        wrote on last edited by
        #3

        Seems like everything is there. That doesn't answer the question of why is the QFactoryLoader looking in "<bundle>/Contents/MacOs/platforms" for the lib when the macdeployqt setup puts it in "<bundle>/Contents/PlugIns/platforms".

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          Sorry, didn't see that, yeah normally it should first look what qt.conf says the plugins are (i.e. "PlugIns").
          When it looks in "<bundle>/Contents/MacOs/platforms" that's a Windows vestige, or a fallback when the path specified in qt.conf is missing or invalid.

          Actually there are more ways to load that libqcocoa.dylib, if qt.conf fails you, if you excel at hex editing you could change the path specified in "<bundle>/Contents/Frameworks/QtCore.framework/Versions/5/QtCore", to see the current setting, cd there and type:
          strings QtCore | grep qt_prfxpath

          P.S. I've written a blog post about this but it's a bit old, it says grep for "qt_plugpath" but nowadays it is "qt_prfxpath"

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jpraccio
            wrote on last edited by
            #5

            Thanks,

            From your docs, I used QCoreApplication::addLibraryPath("PlugIns").
            That worked. Now onto the next error:

            QtQuick is not installed.

            It seems like the deploy tool, while it copied everything, is not doing much else.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jpraccio
              wrote on last edited by
              #6

              Which was just making sure the qml was scanned with macdeployqt's -qmldir flag.

              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